Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: set max_memory from command line


From   Jasper Haller <[email protected]>
To   [email protected]
Subject   Re: st: set max_memory from command line
Date   Thu, 06 Mar 2014 17:20:49 +0100

Dear Bill,

thank you for your quick response. While I could recreate #4 in your e-mail, it only provides an imperfect workaround for my purposes. What I ultimately want to do is run a large number of do-files in batch mode, and before I begin, I would like to set max_memory once for running all these files. If I understand correctly, implementing your workaround #4 would require me to re-write all these do-files and add the line -set max_memory 10g- at the beginning of every do-file. This is precisely what I wanted to avoid having to do by choosing the option -permanently-.

Still, your suggestion points towards a solution. In my Python program that calls upon my do-files and executes them in batch mode, I can probably create a wrapper of sorts that inserts the line -set max_memory 10g- automatically into a do-file before executing it.

Thanks,
Jasper


On 06.03.2014 16:31, William Gould, StataCorp LP wrote:
Jasper <[email protected]> reports that
the values of Stata's memory parameters that he has previously
-set, premanently- are ignored when running Stata for Linux
in batch mode.

I have recreated the problem.  On my Linux computer,

     1.  I ran Stata interactively and I typed

               . set max_memory 10g, permanently

         I then exited Stata.


     2.  I ran Stata interacively again and I typed
. query memory

         The 10g max_memory was displayed just as it should be.

         I exited Stata.


     3.  I created a file called report.do containing one line, to wit

               ------------------------------ report.do ---
               query memory
               ------------------------------ report.do ---

         I then typed at the Unix prompt

              $ stata -b do report

         That ran fine, but when I looked at the resulting report.log,
         I was disappointed to discover that max_memory was ., not
         10g.

I was disappointed because that means Stata has a bug and we at StataCorp
will have to track it down and fix it.

Until we get the problem fixed, I do have a workaround.  The following
works:

     4.  I created file trythis.do containing

               ------------------------------ trythis.do ---
               set max_memory 10g
               query memory
               ------------------------------ trythis.do ---

         I then typed at the Unix prompt,

              $ stata -b do trythis

         That ran fine as results are just as they should be.
         -query memory- reported that max_memory was 10g.

I tested #4 using a Stata for Unix with max_memory set permanently to 10g,
and with max_memory permanently set to 0g.

-- Bill
[email protected]
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index