Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: OS memory availability


From   "Michael Blasnik" <michael.blasnik@verizon.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: OS memory availability
Date   Tue, 30 Mar 2004 16:56:06 -0500

You can set up the windows xp performance monitor to write a log file (in
tab delimited or other format) containing many different system parameters,
including free physical memory.  This log can be set to automatically update
itself at whatever time interval you want.  Presumably,  you could write an
ado in Stata to read this ascii log file and lookup the free physical
memory.  It appears that you would have to set this up to run all the time,
but there may be someway to use Stata's shell function to start and stop the
log when you want -- but I'm not sure how.

Michael Blasnik
michael.blasnik@verizon.net

----- Original Message ----- 
From: "David Kantor" <dkantor@jhu.edu>
To: <statalist@hsphsun2.harvard.edu>
Sent: Tuesday, March 30, 2004 4:20 PM
Subject: Re: st: OS memory availability


> I see that we are asking about two different things: the maximal possible
> memory you can request, and the amount you can request without going into
> virtual memory.  But in either case, we seem to be getting our results by
> experimentation -- and getting rough results.  It would be much better if
> there were a way to directly and exactly get the info we seek.
>
> -- David
>
> At 02:23 PM 3/30/2004 -0600, you wrote:
> >Thanks for the comments. I wrote the following program to try to get at
> >the issue. It reports back the level of memory that does not get an "op.
> >sys. refuses to provide memory" error.
> >
> >*! memtest.ado v1.0.0 fw 3/30/04 determines maximum allowable memory
> >*! and current memory. Allowable value is passed on in local memtest
> >*! keywords: memory
> >program define memtest
> >    version 8.2
> >    qui query memory
> >    local oldmem = `r(memory)'
> >    local memtest = 2000
> >    while `memtest' > 100 {
> >    cap set mem `memtest'm
> >    *di "`memtest'  " _rc
> >    if _rc == 0 {
> >       di in green "Maximum value of memory allowed by OS is " in
> > yellow"`memtest'm"
> >       continue, break
> >    }
> >    local memtest = `memtest' - 100
> >    }
> >    * di "`oldmem'"
> >    set mem `oldmem'k
> >end
> >
> >
> >Fred
> >[...]
>
> David Kantor
> Institute for Policy Studies
> Johns Hopkins University
> dkantor@jhu.edu
> 410-516-5404


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index