Re: help with: Immobile code space exhausted

Matt Kaufmann <[email protected]> Mon, 22 Jun 2026 08:50:10 -0500
Newsgroups gmane.lisp.steel-bank.general
Message-ID <[email protected]>
You could try compiling SBCL from source with something like the
following.

sh make.sh --without-immobile-space --without-immobile-code --without-compact-instance-header 

This has worked well for me (nearly a decade now).  For more details
see:

https://groups.google.com/g/sbcl-help-archive/c/_8oA5K0l0xw?pli=1

-- Matt
Andrew Wolven <[email protected]> writes:

> [1:multipart/alternative Hide]
>
>
> [1/1:text/plain Hide]
>
> I'm writing because trial and error is extremely time consuming.  The files
> I have to load to get to this error take 21 minutes to load on my computer,
> and then I have to rebuild sbcl.  So round trips for replicating this error
> take about 30 minutes.
>
> I am on sbcl-2.6.4 (WIP commit) on Windows on x64-64.
>
> I have source code files which define bindings, which probably equates to
> about 60,000 foreign function definitions and several hundred
> callback definitions, and is about 300 mb of source.  I also have many
> string constants which are different.  I could probably make the number of
> string constants smaller, but at some later time.
>
> I'm trying to rebuild sbcl to have suitable values for the space sizes to
> avoid this error.
>
> The error occurs after I load the bindings and DLLs, one compile of the
> bindings test files is ok, and the tests run, but if I compile the bindings
> test file again I hit this Immoble space error.
>
> The bindings test file does not define any more bindings, it just calls
> foreign functions and accepts callbacks.  I don't need to actually run the
> code in the test file to hit the error, as I said just compiling that file
> twice will trigger the problem.  The bindings work, but that is aside the
> point.
>
> Could someone familiar with tweaking these various memory space sizes in
> the sbcl build give me some hints on what numbers to change before I spend
> several more hours doing trial and error?
>
> Thanks,
> Andrew Wolven
>
> Here is the backtrace:
>
> Immobile code space exhausted
>    [Condition of type SIMPLE-ERROR]
>
> Restarts:
>  0: [*ABORT] Return to SLY's top level.
>  1: [ABORT] abort thread (#<THREAD tid=85460 "slynk-worker" RUNNING
> {164330F2B3}>)
>
> Backtrace:
>  0: (SB-C:ALLOCATE-CODE-OBJECT :IMMOBILE 5 120)
>  1: (SB-FASL::FOP-LOAD-CODE #S(SB-FASL::FASL-INPUT :STREAM
> #<SB-SYS:FD-STREAM for "file h:\\cxxbinder\\clanglite\\clanglite-test.fasl"
> {16682F0533}> :TABLE #(7595 "h:/cxxbinder/clanglite/clanglite-test.li..
>  2: (SB-FASL::LOAD-FASL-GROUP #S(SB-FASL::FASL-INPUT :STREAM
> #<SB-SYS:FD-STREAM for "file h:\\cxxbinder\\clanglite\\clanglite-test.fasl"
> {16682F0533}> :TABLE #(7595 "h:/cxxbinder/clanglite/clanglite-test...
>  3: ((LAMBDA NIL :IN SB-FASL::LOAD-AS-FASL))
>  4: (SB-IMPL::CALL-WITH-LOADER-PACKAGE-NAMES #<FUNCTION (LAMBDA NIL :IN
> SB-FASL::LOAD-AS-FASL) {16682F37AB}>)
>  5: (SB-FASL::LOAD-AS-FASL #<SB-SYS:FD-STREAM for "file
> h:\\cxxbinder\\clanglite\\clanglite-test.fasl" {16682F0533}> NIL NIL)
>  6: ((LABELS SB-FASL::LOAD-STREAM-1 :IN LOAD) #<SB-SYS:FD-STREAM for "file
> h:\\cxxbinder\\clanglite\\clanglite-test.fasl" {16682F0533}> T)
>  7: (SB-FASL::CALL-WITH-LOAD-BINDINGS #<FUNCTION (LABELS
> SB-FASL::LOAD-STREAM-1 :IN LOAD) {3B1D6F08B}> #<SB-SYS:FD-STREAM for "file
> h:\\cxxbinder\\clanglite\\clanglite-test.fasl" {16682F0533}> T #<SB-SYS:..
>  8: (LOAD #P"h:/cxxbinder/clanglite/clanglite-test.fasl" :VERBOSE NIL
> :PRINT NIL :IF-DOES-NOT-EXIST :ERROR :EXTERNAL-FORMAT :DEFAULT)
>  --more--
>
> [1/2:text/html Show Save:noname (3kB)]
>
>
> [2:text/plain Hide]
>
>
> [3:text/plain Hide]
>
> _______________________________________________
> Sbcl-help mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sbcl-help