Hi, I am running R from windows 95. I have a large simulation, which R does not get very far through before telling me: "error cannot allocate vector of size 871875 Kb" and warning message "reached total allocation of 127 Mb" I have been trying to increase the memory allocation to R from my computer, using various commands at the R prompt, such as memory.limit(size=......) to which R responds "NULL" or "cannot decrease memory limit" (no matter how large I try to make the argument of memory.limit. Does anybody have any ideas re how I can get this simulation to run? Many thanks, Shane Stanton
Please read the appropriate FAQ (rw-FAQ), as the posting guide asks. ^^^^^^^^^^^^^^^^^^^^^^^^^ 2.7 There seems to be a limit on the memory it uses! lokks relevant, and is. (So was some more info given with that error message.) On Tue, 28 Sep 2004, shane stanton wrote:> Hi, > > I am running R from windows 95. I have a large > simulation, which R does not get very far through > before telling me: > > "error cannot allocate vector of size 871875 Kb" > > and warning message "reached total allocation of 127 > Mb" > > I have been trying to increase the memory allocation > to R from my computer, using various commands at the R > prompt, such as memory.limit(size=......) to which R > responds "NULL" or "cannot decrease memory limit" (no > matter how large I try to make the argument of > memory.limit. > > Does anybody have any ideas re how I can get this > simulation to run? > > Many thanks, > > Shane Stanton > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > >-- 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
I don't know your details, but some remarks, which might be concerned with memory problems under windows (1) consider e.g. linux, which is better able to manage 2Gb of RAM. (2) look at the gc() (garbage collector): call it after a rm() command, to really free memory (3)allocate memory for arrays this way: x <- rep(0, 64 * 64 * 16 * 1000) dim(x) <- c(64,64,16,1000) and call gc() after this definition, since even this way twice the memory necessary for x is assigned Cheers Christoph shane stanton wrote:> Hi, > > I am running R from windows 95. I have a large > simulation, which R does not get very far through > before telling me: > > "error cannot allocate vector of size 871875 Kb" > > and warning message "reached total allocation of 127 > Mb" > > I have been trying to increase the memory allocation > to R from my computer, using various commands at the R > prompt, such as memory.limit(size=......) to which R > responds "NULL" or "cannot decrease memory limit" (no > matter how large I try to make the argument of > memory.limit. > > Does anybody have any ideas re how I can get this > simulation to run? > > Many thanks, > > Shane Stanton > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > >
On Tue, 2004-09-28 at 07:09, shane stanton wrote:> Hi, > > I am running R from windows 95. I have a large > simulation, which R does not get very far through > before telling me: > > "error cannot allocate vector of size 871875 Kb" > > and warning message "reached total allocation of 127 > Mb" > > I have been trying to increase the memory allocation > to R from my computer, using various commands at the R > prompt, such as memory.limit(size=......) to which R > responds "NULL" or "cannot decrease memory limit" (no > matter how large I try to make the argument of > memory.limit. > > Does anybody have any ideas re how I can get this > simulation to run? > > Many thanks, > > Shane Stanton > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.htmlHi Shane, I had a similar problem and the way to go over it is to save simulation results to the disk and clean the workspace. Imagine you're running 1000 simulations and you save each result into a list. You're object will grow and eat all you're memory. One way to go is to save each simulation result to you're hard drive with "save" and run the next simulation reusing the results object. That way you keep memory requirements controlled. Off course you must be able to run one simulation, if not than you should check you're code and try to improve it. Something that might also help is to remove the results object after saved to the hard drive. Regards EJ