memory leaks

Started by
8 comments, last by phantom007 22 years, 1 month ago
If you had a memory leak somewhere in your program, what would you look for? and how could you test it?
www.koalacomics.com.au for a humour comic
www.lobag.com for my fantasy RPG PBBG
www.testcricketmanager.com for my sports management game
Advertisement
Over #define and overload new & malloc, make them take __LINE__ and __FILE__ parameters, and build a map of all memory allocations.
Over #define and overload delete and free, and remove entries from the map.

Upon program termination, print out the remaining items in the map. Voila, the line and file the leak occur at.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
First thing I will do is check all my text books and work out how to do what you have suggested. Then I''ll definatley try it.

www.koalacomics.com.au for a humour comic
www.lobag.com for my fantasy RPG PBBG
www.testcricketmanager.com for my sports management game
No no no! It is already done by Paul Nattle:

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

Cheers
ooops, it seems the webpage has changed to:

ftp://ftp.3dmaileffects.com/pub/FluidStudios/MemoryManagers/Fluid_Studios_Memory_Manager.zip

Why wouldn't you want to use MSVCRT debug routines from <crtdbg.h>?

Deciding between Direct3D and OpenGL... but keeping the rest of DirectX and MFC.

[edited by - IndirectX on March 19, 2002 3:16:44 PM]
---visit #directxdev on afternet <- not just for directx, despite the name
>>Why wouldn''t you want to use MSVCRT debug routines from ?

From the ''life is too hard'' files -> beleive it or not the de-bugger will not work because of a hardware confliction.
I have done all the obvious things like re-install the software, install a mates software, and after a virus I re-installed everything. I have a dual boot system and it doens''t work on either system. I also do know how to use the de-bugger properly becuase when I have minor problems I go across the road to my local computer store and install my software and de-bug everything in minutes, but I can only do that if none of the owners are there

As for the other things that people have suggested, I am currently trying everything The memory manager is an interesting program and it says I have 172 memory leaks that all come from the same line of code, because it''s legacy code I have to read up on the line in my text books to see what it does!

www.koalacomics.com.au for a humour comic
www.lobag.com for my fantasy RPG PBBG
www.testcricketmanager.com for my sports management game
Losing memory?
Dropping objects?
Leaking resources?

Resource Management is a new methodology that is a C++ response to Java''s garbage collection without the overhead. You can start using it today.

---------------------------------------------
http://www.relisoft.com/resource/resmain.html
---------------------------------------------



The latest html-versions of "thinkin in C++ Vol.2" also includes some serious informations about Resource Managment ect.

--------------------------------------------------------
http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html
--------------------------------------------------------

or use the ShortCut to the Master Download Site:
http://64.78.49.204/
or dd
http://64.78.49.204/TICPP-2nd-ed-Vol-two.zip
http://64.78.49.204/TICPP-2nd-ed-Vol-one.zip
(Vol 1 rather covers C++/OOP Basics)

unzip and open: (Big or Small Index)
Vol 2: \html\IndexXTOC.htm or \html\Index.htm
Vol 1: Frames-expanded-TOC.html or Frames.html











i would seriously consider trying to fix whatever conflicts you have to get msvc worling properly. because if you have a hardware conflict that breaks the debugger, it could conceivably break the compiler and cause other major problems. especially if you had a virus. just because you have a dual boot dont mean its too different systems. if its a win9x and winnt/xp/2k that uses fat32, then a virus could infect files on either system. (since its just a partition seperarting them). i suggest if you are having serious problems like this, do a complaete format of the entire drive, repartition and reinstall everything.
I did actually get a virus about 4 months ago and completely formated my hard drives and re-installed everything, yet I still had the same problems as before.
www.koalacomics.com.au for a humour comic
www.lobag.com for my fantasy RPG PBBG
www.testcricketmanager.com for my sports management game

This topic is closed to new replies.

Advertisement