Re: help with: Immobile code space exhausted

Andrew Wolven <[email protected]> Mon, 22 Jun 2026 08:57:46 -0500
Newsgroups gmane.lisp.steel-bank.general
Message-ID <CANhGVvSYKL28m4Bt7j_0UWuMahTnf02fMnFgJnB_HF+CnoM5Dg@mail.gmail.com>
--===============5185018633015261850==
Content-Type: multipart/alternative; boundary="000000000000a10aec0654d80723"

--000000000000a10aec0654d80723
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thanks Matt.

To get me by, I quadrupled the text space size and rebuilt.  I will likely
start using your method, because it doesn't require a change to the sbcl
sources.

It would be good if Douglas were to explain more about which of these two
methods is best for my use case.

Thanks,
Andrew

On Mon, Jun 22, 2026 at 8:50=E2=80=AFAM Matt Kaufmann <[email protected]=
du>
wrote:

> 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=3D1
>
> -- 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 t=
he
> > point.
> >
> > Could someone familiar with tweaking these various memory space sizes i=
n
> > 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=3D85460 "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
>

--000000000000a10aec0654d80723
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Thanks Matt.<div><br></div><div>To get me by, I quadrupled=
 the text space size and rebuilt.=C2=A0 I will likely start using your meth=
od, because it doesn&#39;t require a change to the sbcl sources.</div><div>=
<br></div><div>It would be good if Douglas were to explain more about which=
 of these two methods is best for my use case.</div><div><br></div><div>Tha=
nks,</div><div>Andrew</div></div><br><div class=3D"gmail_quote gmail_quote_=
container"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, Jun 22, 2026 at 8:=
50=E2=80=AFAM Matt Kaufmann &lt;<a href=3D"mailto:[email protected]">k=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20=
4);padding-left:1ex">You could try compiling SBCL from source with somethin=
g like the<br>
following.<br>
<br>
sh make.sh --without-immobile-space --without-immobile-code --without-compa=
ct-instance-header <br>
<br>
This has worked well for me (nearly a decade now).=C2=A0 For more details<b=
r>
see:<br>
<br>
<a href=3D"https://groups.google.com/g/sbcl-help-archive/c/_8oA5K0l0xw?pli=
=3D1" rel=3D"noreferrer" target=3D"_blank">https://groups.google.com/g/sbcl=
-help-archive/c/_8oA5K0l0xw?pli=3D1</a><br>
<br>
-- Matt<br>
Andrew Wolven &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">aw=
[email protected]</a>&gt; writes:<br>
<br>
&gt; [1:multipart/alternative Hide]<br>
&gt;<br>
&gt;<br>
&gt; [1/1:text/plain Hide]<br>
&gt;<br>
&gt; I&#39;m writing because trial and error is extremely time consuming.=
=C2=A0 The files<br>
&gt; I have to load to get to this error take 21 minutes to load on my comp=
uter,<br>
&gt; and then I have to rebuild sbcl.=C2=A0 So round trips for replicating =
this error<br>
&gt; take about 30 minutes.<br>
&gt;<br>
&gt; I am on sbcl-2.6.4 (WIP commit) on Windows on x64-64.<br>
&gt;<br>
&gt; I have source code files which define bindings, which probably equates=
 to<br>
&gt; about 60,000 foreign function definitions and several hundred<br>
&gt; callback definitions, and is about 300 mb of source.=C2=A0 I also have=
 many<br>
&gt; string constants which are different.=C2=A0 I could probably make the =
number of<br>
&gt; string constants smaller, but at some later time.<br>
&gt;<br>
&gt; I&#39;m trying to rebuild sbcl to have suitable values for the space s=
izes to<br>
&gt; avoid this error.<br>
&gt;<br>
&gt; The error occurs after I load the bindings and DLLs, one compile of th=
e<br>
&gt; bindings test files is ok, and the tests run, but if I compile the bin=
dings<br>
&gt; test file again I hit this Immoble space error.<br>
&gt;<br>
&gt; The bindings test file does not define any more bindings, it just call=
s<br>
&gt; foreign functions and accepts callbacks.=C2=A0 I don&#39;t need to act=
ually run the<br>
&gt; code in the test file to hit the error, as I said just compiling that =
file<br>
&gt; twice will trigger the problem.=C2=A0 The bindings work, but that is a=
side the<br>
&gt; point.<br>
&gt;<br>
&gt; Could someone familiar with tweaking these various memory space sizes =
in<br>
&gt; the sbcl build give me some hints on what numbers to change before I s=
pend<br>
&gt; several more hours doing trial and error?<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Andrew Wolven<br>
&gt;<br>
&gt; Here is the backtrace:<br>
&gt;<br>
&gt; Immobile code space exhausted<br>
&gt;=C2=A0 =C2=A0 [Condition of type SIMPLE-ERROR]<br>
&gt;<br>
&gt; Restarts:<br>
&gt;=C2=A0 0: [*ABORT] Return to SLY&#39;s top level.<br>
&gt;=C2=A0 1: [ABORT] abort thread (#&lt;THREAD tid=3D85460 &quot;slynk-wor=
ker&quot; RUNNING<br>
&gt; {164330F2B3}&gt;)<br>
&gt;<br>
&gt; Backtrace:<br>
&gt;=C2=A0 0: (SB-C:ALLOCATE-CODE-OBJECT :IMMOBILE 5 120)<br>
&gt;=C2=A0 1: (SB-FASL::FOP-LOAD-CODE #S(SB-FASL::FASL-INPUT :STREAM<br>
&gt; #&lt;SB-SYS:FD-STREAM for &quot;file h:\\cxxbinder\\clanglite\\clangli=
te-test.fasl&quot;<br>
&gt; {16682F0533}&gt; :TABLE #(7595 &quot;h:/cxxbinder/clanglite/<a href=3D=
"http://clanglite-test.li" rel=3D"noreferrer" target=3D"_blank">clanglite-t=
est.li</a>..<br>
&gt;=C2=A0 2: (SB-FASL::LOAD-FASL-GROUP #S(SB-FASL::FASL-INPUT :STREAM<br>
&gt; #&lt;SB-SYS:FD-STREAM for &quot;file h:\\cxxbinder\\clanglite\\clangli=
te-test.fasl&quot;<br>
&gt; {16682F0533}&gt; :TABLE #(7595 &quot;h:/cxxbinder/clanglite/clanglite-=
test...<br>
&gt;=C2=A0 3: ((LAMBDA NIL :IN SB-FASL::LOAD-AS-FASL))<br>
&gt;=C2=A0 4: (SB-IMPL::CALL-WITH-LOADER-PACKAGE-NAMES #&lt;FUNCTION (LAMBD=
A NIL :IN<br>
&gt; SB-FASL::LOAD-AS-FASL) {16682F37AB}&gt;)<br>
&gt;=C2=A0 5: (SB-FASL::LOAD-AS-FASL #&lt;SB-SYS:FD-STREAM for &quot;file<b=
r>
&gt; h:\\cxxbinder\\clanglite\\clanglite-test.fasl&quot; {16682F0533}&gt; N=
IL NIL)<br>
&gt;=C2=A0 6: ((LABELS SB-FASL::LOAD-STREAM-1 :IN LOAD) #&lt;SB-SYS:FD-STRE=
AM for &quot;file<br>
&gt; h:\\cxxbinder\\clanglite\\clanglite-test.fasl&quot; {16682F0533}&gt; T=
)<br>
&gt;=C2=A0 7: (SB-FASL::CALL-WITH-LOAD-BINDINGS #&lt;FUNCTION (LABELS<br>
&gt; SB-FASL::LOAD-STREAM-1 :IN LOAD) {3B1D6F08B}&gt; #&lt;SB-SYS:FD-STREAM=
 for &quot;file<br>
&gt; h:\\cxxbinder\\clanglite\\clanglite-test.fasl&quot; {16682F0533}&gt; T=
 #&lt;SB-SYS:..<br>
&gt;=C2=A0 8: (LOAD #P&quot;h:/cxxbinder/clanglite/clanglite-test.fasl&quot=
; :VERBOSE NIL<br>
&gt; :PRINT NIL :IF-DOES-NOT-EXIST :ERROR :EXTERNAL-FORMAT :DEFAULT)<br>
&gt;=C2=A0 --more--<br>
&gt;<br>
&gt; [1/2:text/html Show Save:noname (3kB)]<br>
&gt;<br>
&gt;<br>
&gt; [2:text/plain Hide]<br>
&gt;<br>
&gt;<br>
&gt; [3:text/plain Hide]<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Sbcl-help mailing list<br>
&gt; <a href=3D"mailto:[email protected]" target=3D"_blank">S=
[email protected]</a><br>
&gt; <a href=3D"https://lists.sourceforge.net/lists/listinfo/sbcl-help" rel=
=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/listi=
nfo/sbcl-help</a><br>
</blockquote></div>

--000000000000a10aec0654d80723--


--===============5185018633015261850==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============5185018633015261850==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Sbcl-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-help

--===============5185018633015261850==--