• Advertisement
Sign in to follow this  

Memory leak, or something like that

This topic is 4837 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 not sure if it's called that but I use a whole bunch of virtual memory stuff like = new blah then I delete it, but when I go from the main menu to the options menu then back to the main menu, I gain memory useage in the Windows Task Manager. Is there anyway I can figure out where it's coming from?

Share this post


Link to post
Share on other sites
Advertisement
Is it that you think a program you've coded is leaking memory? If so, I would just code a memory manager (or find one on google) that keeps track of all memory allocations and deallocations.

Share this post


Link to post
Share on other sites
Well the thing is I'm 95% sure that everything is being deleted. And I couldn't find a program on google that check those things.

Share this post


Link to post
Share on other sites
That doesn't mean there's a memory leak. Task manager is a very sucky way to measure memory usage.

Share this post


Link to post
Share on other sites
2DarkNebula: Use BoundsChecker and Intel VTune Perfomance Analyzer - two programs I've found extremely useful to detect memory leaks, perfomance bottlenecks and many other things.

Share this post


Link to post
Share on other sites
That link for the Flipcode Memory manager doesn't work. I was going to look into it because I'm reprogramming the one that I based on superpig's tutorial here. It has worked very well for me, takes some tweaking to get working across all platforms (at least, to compile under GCC3 and VC++ 8). Includes smart pointers and garbage collector; very nice tutorial.

Share this post


Link to post
Share on other sites
Well I can't really use Intel VTune Perfomance Analyzer I just tired it and it seems it doesn't really like athlon too much (I wonder why, lol) Are there any free leak checkers?

Share this post


Link to post
Share on other sites
Hi, check this memory manager from FluidStudios, it is a really great tool.I use it in all my projects.

http://www.fluidstudios.com/pub/FluidStudios/MemoryManagers/Fluid_Studios_Memory_Manager.zip

Regards,
Oscar

Share this post


Link to post
Share on other sites
It's really great! I just have one questions about it. What does this mean:


NOTE! Possible destructor chain: previous owner is GalatronMain.cpp(00295)::??
[-] ----- delete of addr 0x08AAB708 by GUIEngine.cpp(01264)::??
[-] ----- delete of addr 0x08AA9678 by ??(00000)::??
[-] ----- delete of addr 0x08AAD728 by GalatronMain.cpp(00296)::??
[-] ----- delete of addr 0x08AAF7F0 by GalatronMain.cpp(00297)::??

Share this post


Link to post
Share on other sites
Quote:
Original post by bkt
That link for the Flipcode Memory manager doesn't work.
Huh? I just clicked it right now and the link is fine. The code works fine too, I've tried it before.

Sorry I can't help with your latest problem.

Share this post


Link to post
Share on other sites
Hi, well that is info given by the memory manager about the point where you alloc / dealoc memory and it should be located in a file called "memory.txt", in general you could use those info to track when a error is happening. If you dont want to get this info just comment the defines (in file mmgr.cpp) TEST_MEMORY_MANAGER, STRESS_TEST and RANDOM_FAILURE.

I really suggest you read the comments in mmgr.cpp it will tell you about the correct use of the manager and why an how use the defines (TEST_MEMORY_MANAGER, STRESS_TEST and RANDOM_FAILURE), to help you track a memory error.

The file where you SHOULD LOOK FOR MEMORY LEAKS is the one called "memleaks.txt", in this file you will find a list mem leaks (if any) that your app could have.

Hope this helps,
Oscar

Share this post


Link to post
Share on other sites
I did read ALL the comments, I was just asking what is a destructor chain. I've never heard of that. I know how to use the memory manger too, and I got rid of 8 memory leaks which is very nice. Thanks for the link.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement