Christian Schenk | 4 Mar 2008 15:28
Favicon

Re: --mem-max (MiKTeX-2.6) vs. --main-memory (MiKTeX-2.7); How to increase main memory?

Alexander Grahn wrote:
> How do I use --main-memory=... while creating a new format file with
> extended memory in MiKTeX-2.7?

Edit a configuration file for your format. For example, this is an 
excerpt from context.ini:

extra_mem_bot=2000000
extra_mem_top=4000000
main_memory=2000000

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Alexander Grahn | 4 Mar 2008 16:07
Picon
Favicon

Re: --mem-max (MiKTeX-2.6) vs. --main-memory (MiKTeX-2.7); How to increase main memory?

On Tue, Mar 04, 2008 at 03:28:24PM +0100, Christian Schenk wrote:
>Edit a configuration file for your format. For example, this is an 
>excerpt from context.ini:
>
>extra_mem_bot=2000000
>extra_mem_top=4000000
>main_memory=2000000

I opened

%Install%\miktex\config\latex.ini

appended the lines given above, saved the file and recreated all formats by clicking
onto ``Update Formats'' button in the ``General'' tab of MiKTeX options.

When I run LaTeX on the file given below I still get the error:

! TeX capacity exceeded, sorry [main memory size=1500000].

That is, the default hasn't been changed by the actions above.

There is yet another latex.ini:

%Install%\tex\latex\config\latex.ini

But this one doesn't seem to be the right one, because its contents
looks like TeX and was written by Th. Esser.

Alexander

(Continue reading)

Ulrike Fischer | 4 Mar 2008 17:36
Picon

Re: --mem-max (MiKTeX-2.6) vs. --main-memory (MiKTeX-2.7); How to increase main memory?

am Dienstag, 4. März 2008 um 16:07 schrieb Alexander Grahn:

>>Edit a configuration file for your format. For example, this is an
>>excerpt from context.ini:
>>
>>extra_mem_bot=2000000
>>extra_mem_top=4000000
>>main_memory=2000000

> I opened

> %Install%\miktex\config\latex.ini

> appended the lines given above, saved the file and recreated all formats by clicking
> onto ``Update Formats'' button in the ``General'' tab of MiKTeX options.

> When I run LaTeX on the file given below I still get the error:

Your example document works for me if I use

latex --extra-mem-top=2000000 test-img

(without changing any format).

It also works simply with latex test-img if I add to the latex.ini in
miktex\config the line

main_memory=3000000

Sadly it doesn't seem to be possible to make a local latex.ini in a
(Continue reading)

Ulrike Fischer | 4 Mar 2008 17:47
Picon

Re: --mem-max (MiKTeX-2.6) vs. --main-memory (MiKTeX-2.7); How to increase main memory?

am Dienstag, 4. März 2008 um 17:36 schrieb Ulrike Fischer:

> Sadly it doesn't seem to be possible to make a local latex.ini in a
> local texmf tree.

That is wrong: If I open with
initexmf --edit-config-file latex
a latex.ini in the UserConfig-root and add the
main_memory=3000000 line there and then rebuild the format, your
document works too. It looks as if only non-miktex-roots are ignored
(if I didn't make something else wrong during the tests).

--

-- 
Mit freundlichen Grüßen
Ulrike Fischer
mailto:list <at> nililand.de

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Alexander Grahn | 5 Mar 2008 11:16
Picon
Favicon

Re: --mem-max (MiKTeX-2.6) vs. --main-memory (MiKTeX-2.7); How to increase main memory?

Thank you so much, Ulrike and Christan, for your help!

initexmf --edit-config-file=latex.ini

was the decisive advice which solved the problem! I added
main_memory=10000000 and rebuilt the format and now everything works fine!

Only one question I still have. In certain circumstances I get a
save-size-exceeded error message, in particular when using complicated
timelines in conjunction with my animate package. The MiKTeX default is
save_size=5000.

I tried to increase it in the same way as the main_memory. However, the value of
save_size=80000 seems to be the upper limit possible, since larger values cause
the rebuild of the format to fail. Is there a way to break this limit?
Does the max. save_size perhaps depend on another memory setting?

Here is an example file (to be compiled with LaTeX), someone sent to
me:

ftp://ftp.fzd.de/private/grahn/pic.tex

Thanks for your advice!

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Ulrike Fischer | 6 Mar 2008 11:57
Picon

Re: --mem-max (MiKTeX-2.6) vs. --main-memory (MiKTeX-2.7); How to increase main memory?

am Mittwoch, 5. März 2008 um 11:16 schrieb Alexander Grahn:

> Only one question I still have. In certain circumstances I get a
> save-size-exceeded error message, in particular when using complicated
> timelines in conjunction with my animate package. The MiKTeX default is
> save_size=5000.

> I tried to increase it in the same way as the main_memory. However, the value of
> save_size=80000 seems to be the upper limit possible, since larger values cause
> the rebuild of the format to fail. Is there a way to break this limit?
> Does the max. save_size perhaps depend on another memory setting?

> Here is an example file (to be compiled with LaTeX), someone sent to
> me:

> ftp://ftp.fzd.de/private/grahn/pic.tex

Hm, the TeXbook says that it is improbable that you need more than a
save size of 100 if your macros are carefully written, and the LaTeX
companions too claims that it should be difficult to overflow the
current defaults.

In your example the stack overflows already after the 7. frame. Quite
obviously it depends on the number 600*number of frames.

I would say you should try to figure up what is putting so much on the
stack. Try e.g. \tracingrestores=1.

\documentclass{article}
\def\gclcline{}
(Continue reading)

Alexander Grahn | 6 Mar 2008 17:26
Picon
Favicon

save_size, was: --mem-max (MiKTeX-2.6) vs. --main-memory (MiKTeX-2.7); How to increase main memory?

Ulrike,

On Thu, Mar 06, 2008 at 11:57:40AM +0100, Ulrike Fischer wrote:
>I would say you should try to figure up what is putting so much on the
>stack. Try e.g. \tracingrestores=1.

Thanks for this hint. I also read in the TeXBook on page 301 about
save_size. Save stack overflow may occur if there is mixed local and
global assignment to the same variable within a group.

I checked the log file for lines beginning with
{retaining ...
and the associated variable whose value was put on the stack.

However, all of the variables found this way are defined and assigned to
a value in a global fashion, using

\expandafter\xdef\csname <var name>\endcsname{<some value or macro to be expanded>}

There is no local assignment at all, because of the \xdef.

No idea what else to do :(

Alexander

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
(Continue reading)

Ulrike Fischer | 7 Mar 2008 14:48
Picon

Re: save_size, was: --mem-max (MiKTeX-2.6) vs. --main-memory (MiKTeX-2.7); How to increase main memory?

am Donnerstag, 6. März 2008 um 17:26 schrieb Alexander Grahn:

> However, all of the variables found this way are defined and assigned to
> a value in a global fashion, using

> \expandafter\xdef\csname <var name>\endcsname{<some value or macro to be expanded>}

> There is no local assignment at all, because of the \xdef.

After some thoughts and tests I think that the definitions themselves
are also problematic. After all, due to the \expandafter, the \csname
is expanded first and so automatically locally defined to \relax.

I think you should surround this \xdef's with an additional level of
braces, than this local definition will be lost again and can't fill
up the stack:

{\expandafter\xdef\csname <var name>\endcsname{<some value or macro to
be expanded>}}

--

-- 
Mit freundlichen Grüßen
Ulrike Fischer
mailto:list <at> nililand.de

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
(Continue reading)

Alexander Grahn | 7 Mar 2008 15:09
Picon
Favicon

Re: save_size, was: --mem-max (MiKTeX-2.6) vs. --main-memory (MiKTeX-2.7); How to increase main memory?

Hi Ulrike,

thanks for your 2 messages.

On Fri, Mar 07, 2008 at 02:48:10PM +0100, Ulrike Fischer wrote:
>{\expandafter\xdef\csname <var name>\endcsname{<some value or macro to
>be expanded>}}

This has already been done, see line 77 of the current animate.sty [2008/03/05]

Furthermore, following your suggestions of your second last mail, I
tried to reformulate the tests on the existence of \csnames, replacing
e. g.

\expandafter\ifx\csname used <at> #1 <at> \the\ <at> anim <at> tmpcnt\endcsname\relax
...
\else
...
\fi

by

\ifcsname used <at> #1 <at> \the\ <at> anim <at> tmpcnt\endcsname
...
\else
...
\fi

or alternatively by

(Continue reading)

Ulrike Fischer | 7 Mar 2008 16:09
Picon

Re: save_size, was: --mem-max (MiKTeX-2.6) vs. --main-memory (MiKTeX-2.7); How to increase main memory?

am Freitag, 7. März 2008 um 15:09 schrieb Alexander Grahn:

> Furthermore, following your suggestions of your second last mail, I
> tried to reformulate the tests on the existence of \csnames, replacing
> e. g.

> \expandafter\ifx\csname used <at> #1 <at> \the\ <at> anim <at> tmpcnt\endcsname\relax
> ...
> \else
> ...
> \fi

> by

> \ifcsname used <at> #1 <at> \the\ <at> anim <at> tmpcnt\endcsname
> ...
> \else
> ...
> \fi

Should work fine if #1 is not doing something curious:

\documentclass{scrreprt}

\begin{document}
\makeatletter
\newcount\ <at> anim <at> tmpcnt
\expandafter\xdef\csname used <at> a <at> 5\endcsname{a}

\ <at> anim <at> tmpcnt =5
(Continue reading)

Ulrike Fischer | 6 Mar 2008 19:41
Picon

Re: save_size, was: --mem-max (MiKTeX-2.6) vs. --main-memory (MiKTeX-2.7); How to increase main memory?

am Donnerstag, 6. März 2008 um 17:26 schrieb Alexander Grahn:

>>I would say you should try to figure up what is putting so much on the
>>stack. Try e.g. \tracingrestores=1.

> Thanks for this hint. I also read in the TeXBook on page 301 about
> save_size. Save stack overflow may occur if there is mixed local and
> global assignment to the same variable within a group.

> I checked the log file for lines beginning with
> {retaining ...
> and the associated variable whose value was put on the stack.

> However, all of the variables found this way are defined and assigned to
> a value in a global fashion, using

> \expandafter\xdef\csname <var name>\endcsname{<some value or macro to be expanded>}

> There is no local assignment at all, because of the \xdef.

> No idea what else to do :(

I think your tests
\expandafter\ifx\csname used <at> #1 <at> \the\ <at> anim <at> tmpcnt\endcsname\relax are
the problem. If the \csname is not defined it will be set to relax.
And so you have a local definition.

Look at the difference in the log:

\documentclass{scrreprt}
(Continue reading)

Christian Schenk | 4 Mar 2008 17:03
Favicon

Re: --mem-max (MiKTeX-2.6) vs. --main-memory (MiKTeX-2.7); How to increase main memory?

Alexander Grahn wrote:
> On Tue, Mar 04, 2008 at 03:28:24PM +0100, Christian Schenk wrote:
>> Edit a configuration file for your format. For example, this is an 
>> excerpt from context.ini:
>>
>> extra_mem_bot=2000000
>> extra_mem_top=4000000
>> main_memory=2000000
> 
> I opened
> 
> %Install%\miktex\config\latex.ini

It's okay to edit this file for testing purposes. But you should keep in 
mind that it will be "repaired" the next time you update your MiKTeX 
installation.

> 
> appended the lines given above, saved the file and recreated all formats by clicking
> onto ``Update Formats'' button in the ``General'' tab of MiKTeX options.
> 
> When I run LaTeX on the file given below I still get the error:
> 
> ! TeX capacity exceeded, sorry [main memory size=1500000].

The main_memory setting is only relevant in the format file creation 
stage. extra_mem_top and extra_mem_bot must be used to increase TeX's 
memory for your daily work.

> 
(Continue reading)

Alexander Grahn | 4 Mar 2008 17:28
Picon
Favicon

Re: --mem-max (MiKTeX-2.6) vs. --main-memory (MiKTeX-2.7); How to increase main memory?

Christian,

please forgive my thick-wittedness. I still cannot get it working. If I
proceed as in my last message (modifying latex.ini with 

extra_mem_bot=2000000
extra_mem_top=4000000
main_memory=2000000

and rebuilding the formats) and if I run

latex --extra-mem-bot=8000000 myfile.tex

the compilation dies without a message after printing

This is pdfTeX, Version 3.141592-1.40.7 (MiKTeX 2.7)
<An empty line follows before returning to the DOS prompt>

into my DOS command line window.

Would you please give a step-by-step instruction on how to proceed? Maybe
some information on how to use a private latex.ini that doesn't get
overwritten (where to put the file, how to build the format and how to
make use of it)?

This would be great!

Alexander

-------------------------------------------------------------------------
(Continue reading)

Christian Schenk | 4 Mar 2008 17:44
Favicon

Re: --mem-max (MiKTeX-2.6) vs. --main-memory (MiKTeX-2.7); How to increase main memory?

Alexander Grahn wrote:
> Christian,
> 
> please forgive my thick-wittedness. I still cannot get it working. If I
> proceed as in my last message (modifying latex.ini with 
> 
> extra_mem_bot=2000000
> extra_mem_top=4000000
> main_memory=2000000
> 
> and rebuilding the formats) and if I run

You do not need to rebuila the format files.

> 
> latex --extra-mem-bot=8000000 myfile.tex

Why --extra-mem-bot?

> Would you please give a step-by-step instruction on how to proceed?

Sure:

1. Drink a cup of coffee.
2. Read the --extra-mem-top documentation.
3. Use --extra-mem-top (not --extra-mem-bot).

If you want to increase extra-mem-top for all future LaTeX runs, then 
you have to create a private latex.ini configuration file:

(Continue reading)


Gmane