Solved

program memory usage

Posted on 2000-03-07
7
172 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Concatenate 2 userform comboboxes to a userform text box 4 63
MS Date Picker 64 bit 32 bit issue 12 54
VB 6 error 5 in windows 10 but not in XP 7 56
Advice in Xamarin 21 79
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…

777 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