Thread: Deallocating from the heap

  1. #1
    Registered User
    Join Date
    Oct 2010

    Deallocating from the heap

    OK I know this is bad practice, but if you never free something that was malloc'd in a program, ran out of heap space (memory leak obviously), then killed the program, what exactly happens to that malloc'd memory that never got freed during the duration of the program? Nothing? Or does it get deallocated magically somehow?

  2. #2
    Registered User
    Join Date
    Dec 2008
    Black River
    Any modern OS will set all memory pages used by your application to "free" again.
    Stick close to your desks and never program a thing,
    And you all may sit in the standards commitee!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. heap sort
    By mherald81 in forum C Programming
    Replies: 16
    Last Post: 10-31-2010, 09:21 AM
  2. heap
    By George2 in forum Windows Programming
    Replies: 2
    Last Post: 11-10-2007, 11:49 PM
  3. Heap Work
    By AndyBomstad in forum C++ Programming
    Replies: 1
    Last Post: 05-16-2005, 12:09 PM
  4. Do you know...
    By davejigsaw in forum C++ Programming
    Replies: 1
    Last Post: 05-10-2005, 10:33 AM
  5. heap question
    By mackol in forum C Programming
    Replies: 1
    Last Post: 11-30-2002, 05:03 AM