Obviously Wikipedia has a fair amount of information on the topic, but I wanted to make sure I understand. And from what I can tell it\'s important to understand the stack/h
In garbage-collected systems, the term "memory leak" can sometimes seem a bit nebulous. I would offer the following definition, which is just as applicable to garbage-collected systems as to those which use explicit deallocation: A program or subprogram P has a memory leak if there exists an initial sequence of inputs S and repeating pattern of inputs P, such that:
It is possible for a program without a memory leak to have memory usage which is unbounded with respect to the size of the input, if all of the input is in fact contributing to the program's state. For example, a program to read in an input file and write it out in reverse order will require enough memory to hold the file. On the other hand, a program with a memory leak will require an unbounded amount of memory to handle an infinite input stream, even though the amount of memory required should be finite.