Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder complete's Avatar
    Join Date
    Jul 2005
    Location
    USA
    Posts
    87
    Thanks
    2
    Thanked 0 Times in 0 Posts

    2 cool websites I have found

    Apart from buying BoundsChecker or any of the other tools to track down memory leaks. Does anyone have any advice or tips from your years of programming experience to offer on how to track down the causes of memory leaks?

    I find that the big dump that happens at the end of a program does not typically lend any useful clues as to where or what was allocated that was not freed. I find that I have to back track and comment out sections of code until through the process of elimination and trial-and-error, I am able to narrow down where the problem is. And since this is usually at the bottom of the To-Do list, the memory leaks are not plugged.

  • #2
    Regular Coder
    Join Date
    May 2004
    Location
    New Hampshire, America
    Posts
    246
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Not releasing pointers created with a new command, arrays not released properly. e.g:
    char *DelMe[] = new char[20];

    use: delete [] DelMe;
    instead of: delete DelMe;

    There's a debug.h header that allows for asserts and such, just use your MSDN. I could go on for days here...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •