On Wed, Mar 21, 2007 at 04:57:06PM +1200, Erik Garrison wrote:
> When I run
> * (loop for i upto 100000000 collect i)
> I get a "heap exhausted during garbage collection" error. The same
> problem occurs in other high-mem situations (e.g. reading 800gb of XML
> data into a list of trees).
> Additionally, running:
> * (loop for i upto 25000000 collect i)
> twice causes the same error.
> I have a machine with 2gb of RAM. When running this particular example,
> the heap was exhausted with 500mb allocated by SBCL. Over 500mb
> remained free in the system. Why won't SBCL dip into that memory?
> There was a recent thread in this mailing list wrt the same problem. It
> implied that the heap exhaustion occured during the printing of a large
> block of data. To check for this possibility, I have set *print-lines*
> to a reasonable size (1000) (problem remains), and attempted to avoid
> printing altogether by placing the collection loop within a progn that
> returns nil:
> * (progn
> (loop for i upto 100000000 collect i)
> Failure still results.
I was able to remedy this by using --dynamic-space-size 1024
So, now that I've made this big object, how do I get rid of it? The gc
seems to be pretty conservative; even if I hold no references to the
object, running gc explicitly has no effect on memory utilization.