On Nov 27, 2007 10:43 AM, Maurí­cio <briqueabraque@yahoo.com> wrote:
Hi,

If available memory is low, is the
garbage collector going to eliminate
data that is still referenced, but
it knows it can be recalculated when
needed?

If I understand it correctly, when a thunk is evaluated, it is actually replaced by its value in memory.  This suggests that once evaluated, it is impossible to reconstruct the code that was actually used to produce a given value (short of simply rerunning the entire program).  The overhead of keeping around all the code necessary to reproduce any value would be enormous and would clearly cause far more problems with regards to memory usage than it solved. =)

As far as I know, the garbage collector only deallocates memory that is no longer referenced.

-Brent