$ sbcl --no-sysinit --no-userinit
This is SBCL 1.0.58, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (defun test-gc ()
(let ((x (make-array 50000000 :initial-element 0)))
(elt x 0)))
(defun add-one (x) (+ 1 x))
(loop for n from 1 do (format t "~D " n) (force-output) (add-one (test-gc)))
TEST-GC
*
ADD-ONE
* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 C-c C-c
debugger invoked on a SB-SYS:INTERACTIVE-INTERRUPT in thread
#<THREAD "main thread" RUNNING {10036F9023}>:
Interactive interrupt at #x7FFF86FF0542.
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [CONTINUE] Return from SB-UNIX:SIGINT.
1: [ABORT ] Exit debugger, returning to top level.
("bogus stack frame")
0] 1
*
(add-one (test-gc))
(add-one (test-gc))
(add-one (test-gc))
(add-one (test-gc))
(add-one (test-gc))
(add-one (test-gc))
(add-one (test-gc))
(add-one (test-gc))
(add-one (test-gc))
(add-one (test-gc))
(add-one (test-gc))
(add-one (test-gc))
1
*
1
*
1
*
1
*
1
*
1
*
1
*
1
*
1
*
1
*
1
*
1
* (defun test-gc ()
(let ((x (make-array 50000000 :initial-element 0)))
(elt x 0)))
(defun add-one (x) (+ 1 x))
(loop for n from 1 do (format t "~D " n) (force-output) (add-one (test-gc)))
STYLE-WARNING: redefining COMMON-LISP-USER::TEST-GC in DEFUN
TEST-GC
* STYLE-WARNING: redefining COMMON-LISP-USER::ADD-ONE in DEFUN
ADD-ONE
* 1 Heap exhausted during allocation: 399671296 bytes available, 400000016 requested.
Gen StaPg UbSta LaSta LUbSt Boxed Unboxed LB LUB !move Alloc Waste Trig WP GCs Mem-age
0: 1797 0 0 0 23 0 0 0 0 720128 33536 10737418 0 0 0.0000
1: 0 0 0 0 16 1 12208 0 12214 400473632 115168 411211050 6 233 0.0000
2: 0 0 0 0 0 0 0 0 0 0 0 2000000 0 0 0.0000
3: 0 0 0 0 0 0 0 0 0 0 0 2000000 0 0 0.0000
4: 0 0 0 0 0 0 0 0 0 0 0 2000000 0 0 0.0000
5: 0 0 0 0 0 0 0 0 0 0 0 2000000 0 0 0.0000
6: 0 0 0 0 1598 161 0 0 0 57638912 0 2000000 1555 0 0.0000
Total bytes allocated = 458832672
Dynamic-space-size bytes = 1073741824
GC control variables:
*GC-INHIBIT* = false
*GC-PENDING* = true
*STOP-FOR-GC-PENDING* = false
debugger invoked on a SB-KERNEL::HEAP-EXHAUSTED-ERROR in thread
#<THREAD "main thread" RUNNING {10036F9023}>:
Heap exhausted (no more space for allocation).
There are still 399671296 bytes available; the request was for 400000016 bytes.
PROCEED WITH CAUTION.
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit debugger, returning to top level.
(SB-KERNEL::HEAP-EXHAUSTED-ERROR 399671296 400000016)
0] :bt
:BT
0] :backtrace
0: (SB-KERNEL::HEAP-EXHAUSTED-ERROR 399671296 400000016)
1: ("foreign function: call_into_lisp")
2: ("foreign function: funcall2")
3: ("foreign function: gc_heap_exhausted_error_or_lose")
4: ("foreign function: gc_find_freeish_pages")
5: ("foreign function: gc_alloc_large")
6: ("foreign function: general_alloc")
7: ("foreign function: alloc_tramp")
8: (TEST-GC)
9: ((LAMBDA ()))
10: (SB-INT:SIMPLE-EVAL-IN-LEXENV
(LOOP FOR N FROM 1
DO (FORMAT T "~D " N) (FORCE-OUTPUT) (ADD-ONE (TEST-GC)))
#<NULL-LEXENV>)
11: (EVAL
(LOOP FOR N FROM 1
DO (FORMAT T "~D " N) (FORCE-OUTPUT) (ADD-ONE (TEST-GC))))
12: (INTERACTIVE-EVAL
(LOOP FOR N FROM 1
DO (FORMAT T "~D " N) (FORCE-OUTPUT) (ADD-ONE (TEST-GC)))
:EVAL
NIL)
13: (SB-IMPL::REPL-FUN NIL)
14: ((LAMBDA () :IN SB-IMPL::TOPLEVEL-REPL))
15: (SB-IMPL::%WITH-REBOUND-IO-SYNTAX
#<CLOSURE (LAMBDA # :IN SB-IMPL::TOPLEVEL-REPL) {1003700ECB}>)
16: (SB-IMPL::TOPLEVEL-REPL NIL)
17: (SB-IMPL::TOPLEVEL-INIT)
18: ((FLET #:WITHOUT-INTERRUPTS-BODY-238142 :IN SAVE-LISP-AND-DIE))
19: ((LABELS SB-IMPL::RESTART-LISP :IN SAVE-LISP-AND-DIE))
0] C-c C-z
[1]+ Stopped sbcl --no-sysinit --no-userinit
$ top -l1
…
SharedLibs: 5212K resident, 6192K data, 0B linkedit.
MemRegions: 15573 total, 534M resident, 10M private, 158M shared.
PhysMem: 492M wired, 794M active, 118M inactive, 1404M used, 643M free.
VM: 146G vsize, 1043M framework vsize, 358207(0) pageins, 212786(0) pageouts.
…
PID COMMAND %CPU TIME #TH #WQ #PORTS #MREGS RPRVT RSHRD RSIZE VPRVT VSIZE PGRP PPID STATE UID FAULTS COW MSGSENT MSGRECV SYSBSD SYSMACH CSW PAGEINS USER
25606 top 0.0 00:00.07 1/1 0 21+ 32+ 732K+ 336K+ 1268K+ 18M+ 2378M+ 25606 284 running 0 982+ 51+ 34763+ 17381+ 310+ 17467+ 12+ 0 root
25557 sbcl 0.0 04:25.14 2 0 21+ 314+ 45M+ 416K+ 17M+ 236M+ 3416M+ 25557 284 sleeping 502 22989970+ 190+ 20395+ 8931+ 12275+ 10222+ 127240+ 15085+ devon
11645 sbcl 0.0 01:23.86 6 0 66+ 1030+ 11M+ 420K+ 12M+ 306M+ 3505M+ 11645 220 sleeping 502 69683+ 880+ 2420018+ 1189372+ 1334294+ 1183275+ 1289443+ 4339+ devon
…