Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: Not enough memory message after -keep in 1-


From   Sergiy Radyakin <serjradyakin@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Not enough memory message after -keep in 1-
Date   Fri, 12 Aug 2011 18:50:38 -0400

Dear All, Stata shows some rather inefficient behavior in the following code:

clear
set mem 1g
set obs 52428770
gen double x=uniform()
memory
keep in 1

(11MP/32bit and earlier 32-bit versions, not tested with Stata 12).

Seems that Stata is requiring memory for an additional variable (I
suspect "touse")
to keep the first observation, which in this case is causing a "not
enough memory"
error.

I was under impression that "in A/B" is present in the Stata's syntax
precisely for
efficiency reasons, but from above it follows that it is fully equivalent to
if inrange(_n, A,B).

Is this correct or how is "in" different?

Thank you, Sergiy
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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   |   Site index