in reply to Memory and garbage collection

A memory leak is where memory is allocated by the process, but is unreachable and unusuable. This means that when the memory would normally have been released back to the pool of allocatable memory, it isn't. Thus, a loop that would normally consume a given amount of memory and no more now consumes a little more each time (ie, it's leaking).

Only processes leak memory. When a process ends, the OS reclaims that memory and the process, since it's finished, has nothing to say on the matter. Processes only borrow memory from the OS. When they're done, the OS gets it back.

Does that help?


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?