I managed to get a capacity exceeded message by adding a bit too many named coordinates to a number of tikzpictures and so started to test and now wonder if it is possible to release unneeded space in the string pool.

As an example: The following document creates quite a number of (local!) definitions and dies with pdflatex (TL2016) with the message

! TeX capacity exceeded, sorry [pool size=6136953].
\__prg_map_2:w ...sname test#1_17156_tl\endcsname 

It dies with lualatex with the message

! TeX capacity exceeded, sorry [number of strings=495118].
<recently read> \__int_eval_end: 



\int_step_inline:nnnn { 1 } { 1 } {20000}
  \int_step_inline:nnnn { 1 } { 1 } {25}
   \expandafter\def\csname test##1_#1_tl\endcsname{}


Would it be possible to release the space used by the local definitions and decrease the number of strings after the end of the group? Or is there a way to create really local definitions?

Attention I'm not asking how to enlarge the pool size. I know how to do it.

  • 1
    space can be recaptured in the string pool, as i understand it, only if it was the most recent space assigned. that is one of the reasons why it can "run out" by opening too many files -- something almost always touches the pool when a file is read in, so the file name is "frozen" there. let me see if i can find a reference. – barbara beeton Jun 28 '16 at 12:24
  • Ah, the \csname-in-a-group issue :-) Not sure there is a solution, but it is an 'interesting' one isn't it! – Joseph Wright Jun 28 '16 at 12:27
  • @JosephWright: It is not only \csname (in case you mean commands build with \csname), \def\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX{} fills the pool too, but it much more difficult to overflow it with "normal definitions" than by using \csname and loops. – Ulrike Fischer Jun 28 '16 at 12:35
  • 1
    the section in tex.web regarding the string pool contains the sentence "To destroy the most recently made string, we say |flush_string|." there is no other "cleaning" function in the original program. don't know if the lua gang figured out how to do it. (is this an answer?) – barbara beeton Jun 28 '16 at 12:45
  • 1
    line number in tex.web (Version 3.14159265, January 2014): 1201. – barbara beeton Jun 28 '16 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.