Jump to content
  • Advertisement

Archived

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

fpuig

Query Free Memory

This topic is 5577 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

Hi I need to know if any function in my program is leaking memory. To know that I need a function that show me how much memory my program use or how much memory is free on the system. Had any of you heard about any? Cheers fpuig

Share this post


Link to post
Share on other sites
Advertisement
Override the new and delete which has access to a global variable, which you increment or decrement each time you delete or create something. And before your program exits write the number of objects left that wasnt deleted to a file.

edit: heh, I wrote as I thought, and that wasnt such a good idea.

[edited by - angry on June 18, 2003 4:00:49 PM]

Share this post


Link to post
Share on other sites
I test GlobalMemoryStatus, GetProcessMemoryInfo and Debug directives. Those functions only report memory changes when a block of more than 5600 bytes is reserved. If I just make a couple of news like:

cVector3f* pVector1 = new cVector3f;
cVector3f* pVector2 = new cVector3f;
cVector3f* pVector3 = new cVector3f;

After that calls, it''s supposed that I had reserve 9*sizeof(float) = 36 bytes. But if I check the memory before and after they report the same physical memory (I print the memory in bytes not in Kb)

Is there a way to do a high accurancy measure of the memory? Or Did I miss something?

Cheers
fpuig

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!