1
votes

I am not too familiar with garbage collection in lisp, and I wonder how it is possible to manage it in order to avoid the

fatal error: Heap exhausted during garbage collection in *inferior-lisp*.

SLIME 2.20 and SBCL 2.0.1

Heap exhausted during garbage collection: 0 bytes available, 16 requested.
Gen  Boxed   Code    Raw  LgBox LgCode  LgRaw  Pin       Alloc     Waste        Trig      WP     GCs Mem-age
 1   19685      0      1      0      0      0    5   644710992    359856    21474836   19686       0  1.0000
 2   29304      0      1      0      0      0   13   960070208    196032    21474836   29305       0  0.0000
 3       0      0      0      0      0      0    0           0         0    21474836       0       0  0.0000
 4       0      0      0      0      0      0    0           0         0    21474836       0       0  0.0000
 5     367      1    130     34      0     15   51    17101008    823088    38575844     547      13  0.0000
 6     485      2    221     55      0     10    0    24716944    612720     2000000     773       0  0.0000
 7   15224      0      1      0      0      0    0   498860064     32736     2000000   15225       0  0.0000
           Total bytes allocated    =    2145459216
           Dynamic-space-size bytes =    2147483648
GC control variables:
   *GC-INHIBIT* = true
   *GC-PENDING* = true
   *STOP-FOR-GC-PENDING* = false
fatal error encountered in SBCL pid 84761(tid 0x700000026000):
Heap exhausted, game over.

Error opening /dev/tty: Device not configured
Welcome to LDB, a low-level debugger for the Lisp runtime environment.
ldb> 

I am using an algorithm to solve combinatorial issues, and as you can guess, the field of search increase exponentially. It is no point to increase the dynamic-space-size, because this will not solve the issue. So, the idea is to stop the process before heap exhausted. Something like a condition when a memory limit is reached for instance.

Any help is welcome.

1
There are mailing lists for SBCL, where you can reach more experts: sourceforge.net/p/sbcl/mailmanRainer Joswig

1 Answers

0
votes

It seems that there is no real answer to my question. I found some guidelines with which I will manage my issue. Here are the links for the record: https://sourceforge.net/p/sbcl/mailman/message/30184781/ and https://sourceforge.net/p/sbcl/mailman/message/18414749/