Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

program memory usage

Posted on 2000-03-07
7
Medium Priority
?
179 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Accepted Solution

by:
prozak earned 600 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

597 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