Mika Pihlajam=E4ki <mika.pihlajamaki@...> writes:=20
> Thank you Juho and Dan for your suggestions. I try to restructure
> the program to better fit generational garbage collector.
> BUT this question remains:
> Does the sbcl have to exhaust heap unrecoverably? Could it
> _dynamically temporalily_ either change to 2-generation gc, or force
> deeper gc to keep program running when facing that situatiuon? When
> it is constantly growing hunger for memory it may not be worth
> it. But when it could be only a peak in memory usage, it is worth
> trying rather than dying.
Since the SBCL gencgc is copying, the memory use of a full GC will
take approximately amount-of-live-data*2 + amount-of-garbage. When the
heap is exhausted, you obviously no longer have that extra
amount-of-live-data of memory for the copying. Either you'd need to
trigger a full GC every time more than half the heap is in use, or
make the heap dynamically growable.