Solved

program memory usage

Posted on 2000-03-07
7
170 Views
Last Modified: 2010-05-02
i am writing an application that requires me to obtain the memory usage for a given program under winNT and win2000.  very similar to  what  windows task manager gives you. there must be some API call to get this info. anyone know it? thanks.
0
Comment
Question by:tylerd
  • 4
  • 2
7 Comments
 
LVL 1

Expert Comment

by:prozak
ID: 2593147
Check out the GlobalMemoryStatus API call.
0
 
LVL 2

Author Comment

by:tylerd
ID: 2593239
globalmemorystatus will give the me only the memory usage for the operating system as a whole.  i need to know what apps are using what amount of memory.
0
 
LVL 2

Author Comment

by:tylerd
ID: 2593250
Adjusted points to 150
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Accepted Solution

by:
prozak earned 150 total points
ID: 2593297
What you can do with that is call EnumProcesses to get all the process id's in the system and then call GetProcessMemoryInfo for each process id. Or if you already have a process id you can just call GetProcessMemoryInfo.
0
 
LVL 1

Expert Comment

by:prozak
ID: 2593307
This is in the Process Status Helper library and is available only on WinNT, this won't work on 95/98 to my knowledge.
0
 

Expert Comment

by:neoabacus
ID: 2593315
you could use the GetProcessHeap function to get the handle from the process.. then call HeapSize to determine the size of the process...

see: http://msdn.microsoft.com/library/psdk/winbase/memman_5u7k.htm
0
 
LVL 1

Expert Comment

by:prozak
ID: 2593350
Unfortunately GetProcessHeap will only give you a handle to the heap of the calling process. You can't use this to look at the heaps of other processes.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now