Comment 4 for bug 1154385

Revision history for this message
Dima Akater (akater) wrote :

Note: evaluating the form

(let ((large-number 36000000)) (loop :for i :from 1 :to large-number :collect i) nil)

several times causes heap exhaustion as well, even though intermediate lists are not referenced anymore. In my case, this particular large number makes 3 or even 2 evaluations in a row fatal.

I don't have much experience with GC and actually I wouldn't even expect SBCL's GC to work correctly in the case presented by original poster but I'd certainly expect to be able to safely reevaluate any form that had at least once evaluated successfully in REPL and that discarded all large structures it produced. It seems to me that (gc :full t) can always run between individual evaluations in REPL while user is ruminating over latest results, without causing the user any discomfort.

P.S. I return NIL so that the result is truly discarded and is not referenced, say, by a SLIME presentation.