Jump to content
  • Advertisement

Archived

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

ctoa

how to find memory leak

This topic is 5768 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''m making a model loader and using dynamic memory allocation(malloc & realloc) to allocate memory during importing the model. Then there''s a function to destroy the model using free() function. I did a test to monitor memory leak when I repeatedly import and destroy a model. I used norton systemwork to monitor the PHYSICAL memory used. Everytime I import the model the memory used will increase but when I destroy the model, the memory used will decrease less than it increased(differs by around hundred kilobytes)... so I guess there''s a memory leak in my program... Is this the correct way to monitor memory leak? How to make a program that can calculate how much memory leak it has ?

Share this post


Link to post
Share on other sites
Advertisement
Use a memory manager. I sent you an email with one memory manager ready to use. Just include "Memory_Manager.h" after the <> includes and that''s it.

Example:

#include <windows.h>
#include <stdio.h>

#include "Memory_Manager.h"

// The rest of your includes goes here.

Hasta

Share this post


Link to post
Share on other sites
How do the memory managers work? Do they redefine the new/malloc function?

PM

Share this post


Link to post
Share on other sites
quote:
Original post by Mr_Mav
Use a memory manager. I sent you an email with one memory manager ready to use. Just include "Memory_Manager.h" after the <> includes and that''s it.




Do you know where can I find a memory manager on the web ?

Share this post


Link to post
Share on other sites
Paul Nettle (Midnight) wrote a good (free) memory manager...

Here''s some stuff from the readme file :

"This code originally appeared on www.flipcode.com as an entry to the "Ask Midnight" column titled "Presenting A Memory Manager":

http://www.flipcode.com/askmid/archives.shtml "

And

"You can find the latest version of this source at:

ftp://ftp.GraphicsPapers.com/pub/ProgrammingTools/MemoryManagers/

!IMPORTANT! Please spend just a couple minutes reading the comments at the top of the mmgr.cpp file... it will save you a lot of headaches!"

We scratch our eternal itch
A twentieth century bitch
We are grateful for
Our Iron Lung

Share this post


Link to post
Share on other sites
quote:
Original post by slyterence
...You can find the latest version of this source at:

ftp://ftp.GraphicsPapers.com/pub/ProgrammingTools/MemoryManagers





That link doesn''t work for me...

I googled it and found this one tho





"If you gaze long into an abyss, the abyss will gaze back into you."
- Friedrich Nietzsche (1844-1900)

(my site)

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!