Shinmera / 3d-math

A library implementing the necessary linear algebra math for 2D and 3D computations
https://shinmera.github.io/3d-math/
zlib License
14 stars 2 forks source link

Heap exhausted on SBCL 2.4.5 Windows 10 x64, --dynamic-space-size 4096 is required #8

Closed glhrmfrts closed 1 month ago

glhrmfrts commented 1 month ago

I coudn't load 3d-math on SBCL 2.4.5 running on a Windows 10 x64 machine with 16gb RAM unless I specified the command-line option --dynamic-space-size 4096. Previously I tried with 1024 and 2048 values.

* (ql:quickload :3d-math)
To load "3d-math":
  Load 1 ASDF system:
    3d-math
; Loading "3d-math"
..................................................
..................................................
..................................................
..................................................
................Heap exhausted during garbage collection: 16368 bytes available, 16400 requested.
        Immobile Object Counts
 Gen layout fdefn symbol   code  Boxed   Cons    Raw   Code  SmMix  Mixed  LgRaw LgCode  LgMix Waste%       Alloc        Trig   Dirty GCs Mem-age
  0      0      0      0      0      5    187   3374      0      1   6093      0      0      0   48.3   163576848    77610516       -   1  0.0000
  1      0      0      0      0     29     23  22236      0      1      7      0      0      0   49.9   366352192    21474836   22262   0  0.9240
  2    331   7242    729   9360   3486    802  28510      5     82    304      0      0     56   40.4   649430752     2000000   28622   0  0.6350
  3      0      0      0      0      0      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      0      0    0.0           0     2000000       0   0  0.0000
  5      0      0      0      0      0      0      0      0      0      0      0      0      0    0.0           0     2000000       0   0  0.0000
  6    761  16616  23322  19159    188    109      7      3      8     11      0      0      9    4.0    10536416     2000000      11   0  0.0000
Tot   1092  23858  24051  28519   3708   1121  54127      8     92   6415      0      0     65   44.6  1189895664 [55.4% of 2147483648 max]
GC control variables:
   *GC-INHIBIT* = true
   *GC-PENDING* = true
   *STOP-FOR-GC-PENDING* = false
Collection trigger variables:
   dynamic_space_size = 2147483648
   bytes_allocated = 1189895664
   auto_gc_trigger = 1067050886
   bytes_consed_between_gcs = 107374182
fatal error encountered in SBCL pid 120764188:
Heap exhausted, game over.

Welcome to LDB, a low-level debugger for the Lisp runtime environment.
(GC in progress, oldspace=0, newspace=1)

Further loads are OK with the 1024mb default value, but that was a scary error that was hidden in the *inferior-lisp* buffer that SLIME didn't even report it.

Given that this library will most likely be used in a gamedev context, a more beginner user might be confused and give up doing gamedev in CL altogether.

Perhaps it's worth a mention in the documentation to warn Windows users about this issue and recomend --dynamic-space-size 4096?