Don MacQueen
2002-Oct-14 14:33 UTC
[R] R 1.6.0 Solaris crash with xmalloc: out of virtual memory
[some de-capitalization of *SXP done manually by mailing
list maintainer ; the originally was caught as potential spam. MM]
I have a little R program that crashes with the message
xmalloc: out of virtual memory
The code has a repeat{} loop that watches the sizes of some files.
When there's an increase it updates things by reading the last 65
lines of each file, doing some calculations, and re-making a plot.
After about 260 updates it crashes with the message
xmalloc: out of virtual memory
and returns to the OS.
I inserted calls to gc() and memory.profile().
The value of CHARSXP from memory.profile() increases linearly at a
rate of about 332.6 units per update, from 37178 just after R is
started to 123319 shortly before it crashes. None of the others
change much.
From Rinternals.h,
#define CHARSXP 9 /* "scalar" string type (internal only)*/
and it seems like this should give me a clue where to look in my code
for something that keeps grabbing more memory, but I'm not getting it.
The values returned by gc() change (see below), but I don't know if
the amount of change is significant.
Any suggestions would be most welcome.
Thanks
-Don
> version
_
platform sparc-sun-solaris2.7
arch sparc
os solaris2.7
system sparc, solaris2.7
status
major 1
minor 6.0
year 2002
month 10
day 01
language R
----------------- At the beginning -------------
--- gc() returns:
used (Mb) gc trigger (Mb)
Ncells 254150 6.8 467875 12.5
Vcells 408499 3.2 886807 6.8
--- memory.profile() returns:
NilSXP SymSXP ListSXP CloSXP EnvSXP PromSXP LangSXP SpecialSXP
1 4919 128880 1440 13 18 63607 59
BUILTINSXP CHARSXP LGLSXP - - INTSXP REALSXP CPLXSXP STRSXP
513 37178 1712 0 0 237 9047 8 10201
DOTSXP ANYSXP VECSXP EXPRSXP - EXTPTRSXP WEAKREFSXP
1 0 341 2 0 0 0
---------------- Just before the crash ------------
--- gc() returns:
used (Mb) gc trigger (Mb)
Ncells 347539 9.3 597831 16.0
Vcells 566319 4.4 1103261 8.5
--- memory.profile() returns:
NilSXP SymSXP ListSXP CloSXP EnvSXP PromSXP LangSXP SpecialSXP
1 4921 131330 1440 13 18 63607 59
BUILTINSXP CHARSXP LGLSXP - - INTSXP REALSXP CPLXSXP STRSXP
513 123319 1726 0 0 275 9308 8 10613
DOTSXP ANYSXP VECSXP EXPRSXP - EXTPTRSXP WEAKREFSXP
1 0 427 2 0 0 0
--
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA
--------------------------------------
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Roger Peng
2002-Oct-14 20:10 UTC
[R] R 1.6.0 Solaris crash with xmalloc: out of virtual memory
This may be caused by the memory leak found in the 'deparse' function (on 1.6.0). Maybe you should see if this happens with the latest R-patched? -roger _______________________________ UCLA Department of Statistics rpeng at stat.ucla.edu http://www.stat.ucla.edu/~rpeng On Mon, 14 Oct 2002, Don MacQueen wrote:> [some de-capitalization of *SXP done manually by mailing > list maintainer ; the originally was caught as potential spam. MM] > > I have a little R program that crashes with the message > xmalloc: out of virtual memory > > The code has a repeat{} loop that watches the sizes of some files. > When there's an increase it updates things by reading the last 65 > lines of each file, doing some calculations, and re-making a plot. > After about 260 updates it crashes with the message > xmalloc: out of virtual memory > and returns to the OS. > > I inserted calls to gc() and memory.profile(). > > The value of CHARSXP from memory.profile() increases linearly at a > rate of about 332.6 units per update, from 37178 just after R is > started to 123319 shortly before it crashes. None of the others > change much. > > From Rinternals.h, > #define CHARSXP 9 /* "scalar" string type (internal only)*/ > and it seems like this should give me a clue where to look in my code > for something that keeps grabbing more memory, but I'm not getting it. > > The values returned by gc() change (see below), but I don't know if > the amount of change is significant. > > Any suggestions would be most welcome. > > Thanks > -Don > > > version > _ > platform sparc-sun-solaris2.7 > arch sparc > os solaris2.7 > system sparc, solaris2.7 > status > major 1 > minor 6.0 > year 2002 > month 10 > day 01 > language R > > > ----------------- At the beginning ------------- > --- gc() returns: > used (Mb) gc trigger (Mb) > Ncells 254150 6.8 467875 12.5 > Vcells 408499 3.2 886807 6.8 > > --- memory.profile() returns: > NilSXP SymSXP ListSXP CloSXP EnvSXP PromSXP LangSXP SpecialSXP > 1 4919 128880 1440 13 18 63607 59 > > BUILTINSXP CHARSXP LGLSXP - - INTSXP REALSXP CPLXSXP STRSXP > 513 37178 1712 0 0 237 9047 8 10201 > > DOTSXP ANYSXP VECSXP EXPRSXP - EXTPTRSXP WEAKREFSXP > 1 0 341 2 0 0 0 > > ---------------- Just before the crash ------------ > --- gc() returns: > used (Mb) gc trigger (Mb) > Ncells 347539 9.3 597831 16.0 > Vcells 566319 4.4 1103261 8.5 > > --- memory.profile() returns: > NilSXP SymSXP ListSXP CloSXP EnvSXP PromSXP LangSXP SpecialSXP > 1 4921 131330 1440 13 18 63607 59 > > BUILTINSXP CHARSXP LGLSXP - - INTSXP REALSXP CPLXSXP STRSXP > 513 123319 1726 0 0 275 9308 8 10613 > > DOTSXP ANYSXP VECSXP EXPRSXP - EXTPTRSXP WEAKREFSXP > 1 0 427 2 0 0 0 > > -- > -------------------------------------- > Don MacQueen > Environmental Protection Department > Lawrence Livermore National Laboratory > Livermore, CA, USA > -------------------------------------- > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._