【发布时间】:2020-03-16 11:27:20
【问题描述】:
我对lisp中的垃圾收集不太熟悉,我想知道如何管理它以避免
致命错误:
*inferior-lisp*中的垃圾收集期间堆耗尽。
SLIME 2.20 和 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>
我正在使用一种算法来解决组合问题,您可以猜到,搜索领域呈指数级增长。增加dynamic-space-size 是没有意义的,因为这不会解决问题。所以,这个想法是在堆耗尽之前停止进程。例如,达到内存限制时的条件。
欢迎任何帮助。
【问题讨论】:
-
有 SBCL 的邮件列表,您可以联系到更多专家:sourceforge.net/p/sbcl/mailman
标签: garbage-collection common-lisp sbcl