Re: etex and pdftex have diverging memory constraints?
jfbu via tex-live <[email protected]>
| Newsgroups | gmane.comp.tex.live |
|---|---|
| Message-ID | <[email protected]> |
Thanks to all for your comments.
It seems the actual limits depend on some other local details.
I am joining for the interested a bash script which automatizes finding the upper limit. Don't use it if you do not understand as any such script can execute arbitrary commands.
If you set ETEX in the environment il will use it else it defaults to using etex.
----bash script
#!/bin/bash
# Mercredi 27 août 2025 à 14:27:43
etex="${ETEX:-etex} -halt-on-error -interaction batchmode -- "
BON=1000
ERREUR=""
while :
do
DERNIERBON=$BON
BON=`expr $BON + $BON`
cat > testxintLength.tex <<EOF
\input xintkernel.sty
\edef\x{\romannumeral\xintreplicate{%
EOF
echo "$BON%" >> testxintLength.tex
cat >> testxintLength.tex <<EOF
}{F}}
\expandafter\xintLength\expandafter{\x}
\bye
EOF
echo -n "Test avec $BON: "
$etex testxintLength.tex >/dev/null
if [ $? -eq 0 ]
then
echo -e "\033[32mOK\033[0m"
else
echo -e "\033[1;31mÉCHEC\033[0m"
ERREUR=$(grep '^!' testxintLength.log)
break
fi
done
MAUVAIS=$BON
BON=$DERNIERBON
while :
do
NOUVEAU=`expr \( $BON + $MAUVAIS \) / 2` # troncation
if [ $NOUVEAU -eq $BON ]
then
break
fi
cat > testxintLength.tex <<EOF
\input xintkernel.sty
\edef\x{\romannumeral\xintreplicate{%
EOF
echo "$NOUVEAU%" >> testxintLength.tex
cat >> testxintLength.tex <<EOF
}{F}}
\expandafter\xintLength\expandafter{\x}
\bye
EOF
echo -n "Test avec $NOUVEAU: "
$etex testxintLength.tex >/dev/null
if [ $? -eq 0 ]
then
echo -e "\033[32mOK\033[0m"
BON=$NOUVEAU
else
echo -e "\033[1;31mÉCHEC\033[0m"
MAUVAIS=$NOUVEAU
ERREUR=$(grep '^!' testxintLength.log)
fi
done
echo "$BON is OK, $MAUVAIS is BAD"
echo "I did this using $etex"
echo "extracted from last bad log:"
echo "$ERREUR"
exit 0
---- end of bash script
Here is what happens if I execute at my place:
(only last lines of output shown)
with etex:
Test avec 2492718: ÉCHEC
Test avec 2492702: ÉCHEC
Test avec 2492694: OK
Test avec 2492698: OK
Test avec 2492700: OK
Test avec 2492701: OK
2492701 is OK, 2492702 is BAD
I did this using etex -halt-on-error -interaction batchmode --
extracted from last bad log:
! TeX capacity exceeded, sorry [main memory size=5000000].
with pdftex:
$ export ETEX=pdftex
$ ./testmaxsizes.sh
Test avec 2000: OK
Test avec 4000: OK
... lines removed ...
Test avec 2492687: ÉCHEC
Test avec 2492656: OK
Test avec 2492671: OK
Test avec 2492679: OK
Test avec 2492683: OK
Test avec 2492685: OK
Test avec 2492686: ÉCHEC
2492685 is OK, 2492686 is BAD
I did this using pdftex -halt-on-error -interaction batchmode --
extracted from last bad log:
! TeX capacity exceeded, sorry [main memory size=5000000].
! ==> Fatal error occurred, no output PDF file produced!
To redo test with etex, one would execute "unset ETEX" first.
(I am sorry this is not optimal but it is extracted from some more complex stuff using a Makefile and then one simply adds ETEX=pdftex on the command line)
You may notice this differs from what I reported initially. I do not know what happened. I think I did a rebuild of the etex format after my initial post in order to check the impact of main_memory.
Thanks for your patience,
Jean-François
> Le 27 août 2025 à 16:15, Herbert Voss <[email protected]> a écrit :
>
>
>
> Am 27.08.25 um 16:07 schrieb jfbu via tex-live:
>>
>> It is unavoidable that a crash occurs with etex/pdftex if the 2492679 is replaced by some large enough number, so if you have time to waste on this you can try to set it to a higher value.
>>
>> I am surprised the upper limit at my locale is lower than what you and Herbert experiment... and Herbert confirmed being with TL default memory settings like myself.
>
> with 2492700 it fails:
>
> voss>mist:$ pdfetex xyz.tex
> This is pdfTeX, Version 3.141592653-2.6-1.40.28 (TeX Live 2025) (preloaded format=pdfetex)
> restricted \write18 enabled.
> entering extended mode
> (./xyz.tex (/usr/local/texlive/2025/texmf-dist/tex/generic/xint/xintkernel.sty)
>
> Runaway argument?
> {FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\ETC.
> ! TeX capacity exceeded, sorry [main memory size=5000000].
> \x ...FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\ETC.
>
> l.5 \expandafter\xintLength\expandafter{\x
> }
> ! ==> Fatal error occurred, no output PDF file produced!
> Transcript written on xyz.log.
>
>
> Herbert