Archived

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

AndreTheGiant

how to check memory usage?

Recommended Posts

I often hear people who suspect that they have a memory leak because there is less memory available before they run their program then afterwords. First of all, even if the program did have a memory leak, I though that all moder operating systems reclaim the memory after your program is finished anyway. Im using windoze, and i dont know how you can check how much memory is being used anyway. I can ctrl-alt-del to bring up the task manager, which shows how much memory is being used by the computer, but this is constantly changing, even if my program is not running. So how can you accurately tell that there is less memory available after your program has run? Basically I want to know a good way to tell how much memory my program is using, and I want to know if these other people are simply using the task manager to figure it out, or if i am badly mistaken. Thanks!

Share this post


Link to post
Share on other sites
There are various ways, such as the windows inbuilt performance monitor (found in control panel, set it to monitor your program's threads only), or use a debugger.

%SystemRoot%\system32\perfmon.msc /s

Debuggers usually telly rather quickly about memory leaks.

the actual problem with memory leaks is that some of them are growing, so in a loop, it may heppen that after a few hours (sometimes seconds) or so, your system will run out of memory - and crash, or at least the program crashes.

Very nasty.

Moritz "Thygrrr" Voß
spirit.link.studios
www.optionoverkill.com

[edited by - Thygrrr on October 9, 2003 9:42:51 AM]

Share this post


Link to post
Share on other sites
There is a good free GDI/memory checker, called Memproof - not sure where the link is but it helps with unfreed resources and memory.

I fseek, therefore I fam.

Share this post


Link to post
Share on other sites