From: Bruno H. <br...@cl...> - 2017-05-28 12:20:07
|
Hi all, For debugging GC problems, I have added a new option -nextgc-factor. It is a factor that gets applied to the amount of space that can be consumed before the next GC is triggered. Setting it to large values can inhibit GC for a long time: $ ./lisp.run -q -M lispinit.mem -nextgc-factor 1e9 [1]> (time (setq a (make-array 1000000) b nil)) Real time: 0.038371 sec. Run time: 0.04 sec. Space: 8000016 Bytes NIL [2]> (room) Number of garbage collections: 0 Bytes freed by GC: 0 Time spent in GC: 0.0 sec Bytes permanently allocated: 158,480 Bytes currently in use: 11,107,792 Bytes available until next GC: 1,536,935,991,966,080 11107792 ; 1536935991966080 ; 158480 ; 0 ; 0 ; 0 Setting it to small values can make GCs much more frequent: $ ./lisp.run -q -M lispinit.mem -nextgc-factor 0.001 [1]> (room) Number of garbage collections: 16 Bytes freed by GC: 44,648 Time spent in GC: 1.112 sec Bytes permanently allocated: 158,480 Bytes currently in use: 3,056,200 Bytes available until next GC: 71 3056200 ; 71 ; 158480 ; 16 ; 44648 ; 1112000 [2]> (time (setq a (make-list 1000) b nil)) Real time: 0.687479 sec. Run time: 0.688 sec. Space: 16000 Bytes GC: 10, GC time: 0.688 sec. NIL I don't want to document this option, because the default GC frequency is completely sufficient for the average user. Bruno |