leaked memory not freed after process is killed?

This is a discussion on leaked memory not freed after process is killed? within the Linux Programming forums, part of the Platform Specific Boards category; Another option is to use Electric Fence (gcc prog.c -lefence) to also diagnose mis-use of allocated memory. You could also ...

  1. #16
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    Another option is to use Electric Fence (gcc prog.c -lefence) to also diagnose mis-use of allocated memory.
    You could also try Valgrind. I find it works very well. The thing with Valgrind is that it's basically an entire virtual machine: no instructions are executed directly, Valgrind handles everything. So it lets you detect memory leaks in external libraries and everything. You don't even have to re-compile your program; you don't even need the source for a program to use Valgrind on it.

    Of course, I've never used Electric Fence or any other memory leak detection tools besides Valgrind.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  2. #17
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    In a previous post by the thread-starter:
    i've actually been using valgrind to get an indication of what's going on since the application is rather big...
    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 10-15-2008, 09:24 AM
  2. To find the memory leaks without using any tools
    By asadullah in forum C Programming
    Replies: 2
    Last Post: 05-12-2008, 07:54 AM
  3. Problem with forking a process
    By Unitedroad in forum C Programming
    Replies: 10
    Last Post: 10-04-2007, 01:43 AM
  4. process programming
    By St0rM-MaN in forum Linux Programming
    Replies: 2
    Last Post: 09-15-2007, 07:53 AM
  5. Suggestions on this C style code
    By Joelito in forum C Programming
    Replies: 11
    Last Post: 06-07-2007, 03:22 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21