Thanks for those suggestions. There was no previous part of the session . I opened r then ran the script as seen. In this case the
> rm(list = ls()) was superfluous - I just tend to have it at the beginning of scripts to remove any rubbish if I have run previous stuff in the session. It would be nice if the xlcFreeMemory() gave the maximum available. On Tue, Jun 11, 2013 at 11:02 PM, Anthony Damico <ajdam...@gmail.com> wrote: > the > > > rm(list = ls()) > > at the top of your snippet makes me wonder if you had loaded any packages > (like XLConnect) that use Java in a previous part of the session? i > believe you must designate the ram allocation for java prior to loading any > java-related packages, and clearing out your objects will not act as a > reset.. > > > i'm also not sure if the memory report shows what's currently allocated or > the actual maximum.. i've had success with increasing the allocation on > windows in the past, even though the initial memory report said only > ~120mb. be sure to execute the xlcFreeMemory() command after any big > runs-- it's the java-equivalent of gc() > > > also you should be able to use > options( java.parameters = "-Xmx4g" ) > unless you love multiplying by 1024 :) > > > > > > On Tue, Jun 11, 2013 at 3:21 AM, nevil amos <nevil.a...@gmail.com> wrote: > >> I am using some r scripts to reformat a large data set that needs to be >> saved into xls format. >> >> I am getting the Out of Memory Error (Java) despite having set a >> large >> memory in the first line of the script ( on opening R and before loading >> any libraries) >> >> I am using R version 2.15.2 (2012-10-26) -- "Trick or Treat" >> Platform: x86_64-w64-mingw32/x64 (64-bit) >> >> On 64 Bit window 7 machine with 12G of ram. >> >> When I run the script to increase memory for jvm it is not increasing the >> memory but remaining at 244MB ( presumably the remainder of the initial >> 256mb once JVM is loaded... >> >> the script and out put is as follows >> >> > rm(list = ls()) >> > options(java.parameters = "-Xmx4096m",stringsAsFactors=F) >> > library(XLConnect) >> Loading required package: XLConnectJars >> Loading required package: rJava >> XLConnect 0.2-3 by Mirai Solutions GmbH >> http://www.mirai-solutions.com , >> http://miraisolutions.wordpress.com >> > print(xlcMemoryReport()) >> Amount of free memory in the Java Virtual Machine (JVM): 244.0936 MB >> >> >> How do I increase the memory? >> >> thanks >> >> [[alternative HTML version deleted]] >> >> >> ______________________________________________ >> R-help@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> >> > [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.