Solved

program memory usage

Posted on 2000-03-07
7
173 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

856 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