Laurie Sindlinger
2003-Jul-30 17:36 UTC
[R] Should garbage collection be automatic in R sessions?
Hello all, I am having problems with memory when running R on my PC. I do not have many large objects in my workspace, and yet when trying to create a new vector I often encounter this error message:> lat <- header$lat[match(profile$id, header$id)]Error: cannot allocate vector of size 4575 Kb Since it seems like this may indicate that I don't have enough memory available, I tried increasing nsize using mem.limits, but I still get this error message. Is there a function in R where you can see the size of all objects in the workspace? When I tried using gc(), I was then able to create the vector. It seems to indicate in the help pages that the garbage collection should happen automatically. Does anyone know how often this might take place or how I can check if it is occurring during my R sessions? Thanks for you help, and I have included info about my system below (I have 1 gbyte of memory). Sincerely, Laurie Sindlinger Windows 2000 Intel(R) Pentium (R) 4CPU 2.40 GHz AT/AT COMPATIBLE 1,047,536 KB RAM
Prof Brian Ripley
2003-Jul-30 18:06 UTC
[R] Should garbage collection be automatic in R sessions?
On Wed, 30 Jul 2003, Laurie Sindlinger wrote:> I am having problems with memory when running R on my PC. I do not > have many large objects in my workspace, and yet when trying to create a > new vector I often encounter this error message: > > > lat <- header$lat[match(profile$id, header$id)] > Error: cannot allocate vector of size 4575 Kb > > Since it seems like this may indicate that I don't have enough memory > available, I tried increasing nsize using mem.limits, but I still get > this error message.See what ?mem.limits says about Windows ... ?memory.size (and the rw-FAQ) may be more use to you.> Is there a function in R where you can see the size > of all objects in the workspace?object.size(ls()), but not all objects using memory are in the workspace.> When I tried using gc(), I was then able to create the vector. It > seems to indicate in the help pages that the garbage collection should > happen automatically. Does anyone know how often this might take place > or how I can check if it is occurring during my R sessions? Thanks for > you help, and I have included info about my system below (I have 1 gbyte > of memory).?gcinfo, mentioned on ?mem.limits.> Windows 2000which is not the most efficient OS at using large amounts of memory (although better than Windows 9x). -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Uwe Ligges
2003-Jul-30 18:12 UTC
[R] Should garbage collection be automatic in R sessions?
Laurie Sindlinger wrote:> > Hello all, > > I am having problems with memory when running R on my PC. I do not > have many large objects in my workspace, and yet when trying to create a > new vector I often encounter this error message: > > > lat <- header$lat[match(profile$id, header$id)] > Error: cannot allocate vector of size 4575 Kb > > Since it seems like this may indicate that I don't have enough memory available, I tried increasing nsize using mem.limits, but I still get this error message. Is there a function in R where you can see the size of all objects in the workspace?See ?memory.size and ?memory.limit> When I tried using gc(), I was then able to create the vector. It seems to indicate in the help pages that the garbage collection should happen automatically. Does anyone know how often this might take place or how I can check if it is occurring during my R sessions? Thanks for you help, and I have included info about my system below (I have 1 gbyte of memory).See ?gcinfo Uwe Ligges> Sincerely, > Laurie Sindlinger > > Windows 2000 > > Intel(R) Pentium > (R) 4CPU 2.40 GHz > AT/AT COMPATIBLE > 1,047,536 KB RAM > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help