Re: etex and pdftex have diverging memory constraints?

Jim Diamond <[email protected]>
Newsgroups gmane.comp.tex.live
Message-ID <[email protected]>
On Wed, Aug 27, 2025 at 15:15 (+0200), jfbu via tex-live wrote:

> Hi,

> Sorry if this is very basic, but I always thought the sole difference between etex and pdftex is that the former works to produce a dvi and the latter a pdf.

> So, I was surprised to discover (or perhaps I observed that years ago and forgot) that pdftex has slightly more constrained memory constraints on macro expansion.

> Here is a test file testxintLength.tex

> ----
> \input xintkernel.sty
> \edef\x{\romannumeral\xintreplicate{%     
> 2492679%
> }{F}}
> \expandafter\xintLength\expandafter{\x}
> \bye
> ----

> (the code creates a macro \x expanding to 2492679 F's then attempts to measure how many F's there are).

> Compilation with etex succeeds  (even with 2492694 in place of 2492679).

> $ etex testxintLength.tex
> This is pdfTeX, Version 3.141592653-2.6-1.40.28 (TeX Live 2025) (preloaded format=etex)
> restricted \write18 enabled.
> entering extended mode
> (./testxintLength.tex (./xintkernel.sty) [1] )
> Output written on testxintLength.dvi (1 page, 216 bytes).
> Transcript written on testxintLength.log.

> But compilation with pdftex fails.

> $ pdftex testxintLength
> This is pdfTeX, Version 3.141592653-2.6-1.40.28 (TeX Live 2025) (preloaded format=pdftex)
> restricted \write18 enabled.
> entering extended mode
> (./testxintLength.tex (./xintkernel.sty)
> ! TeX capacity exceeded, sorry [main memory size=5000000].
> <inserted text> 2492679
>                         \xintlength ...xint_c_i \xint_c_ \xint_bye \relax                                                     l.5 \expandafter\xintLength\expandafter{\x}
>                                             !  ==> Fatal error occurred, no output PDF file produced!
> Transcript written on testxintLength.log.

> I am a bit surprised because I can not connect the constraints on TeX macro expansion with the output format DVI or PDF.  Needless to say I am completely ignorant of the innards.

Pdftex works fine on this example (Slackware64 15.0), at least in the sense
that pdftex runs to completion.  The output PDF doesn't show the F's, at
least with the viewer I tried.

Perhaps if you mention what OS you are using some additional help might be
forthcoming.

                                Jim
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.