Archived

This topic is now archived and is closed to further replies.

Win32- How can I retrieve my app's memory consumption?

This topic is 5573 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I would like to know how I can find how much memory my program is using with out pressing Ctrl-Alt-Del and watching the task manager (I''m using Windows XP). Is there a basic Win32 API function or something I can use?

Sub-Terra Software - High quality free games and applications (website under construction)
matt_j@shaw.ca
subterrasoft@hotmail.com

Share this post


Link to post
Share on other sites
Yes, there is. GetProcessMemoryInfo is the call you are looking for. An example of how to use it is here.

You will notice both of these links lead to msdn.microsoft.com. Learn it, use it. Then use it some more . Seriously though, I found that information by searching on "process memory". First hit was that information. You will save yourself and others time by checking it first.

Notice however that these calls are unsupported on win9x systems. A lot of the advanced memory management calls are unavailable on win9x. An alternate method of detecting how much memory you are using is by overriding the new and delete operators to track it manually if you are using c++.

To be honest I''m not sure how else to find out a processes memory usage under win9x, although I believe there is a way. Good luck.

Share this post


Link to post
Share on other sites