Feldman, Maximilian Jeffrey
2007-Jul-19 00:09 UTC
[R] RAM, swap, Error: cannot allocate vector of size, Linux:
Dear Community, I am very new to the world of Linux and R and I have stumbled upon a problem that I cannot seem to resolve on my own. Here is the relevant background: I am working on a 64-bit Linux Fedora Core 6 OS. I using R version 2.5.1. I have 3.8 Gb of RAM and 1.9 Gb of swap. As I see it, there are no restraints on the amount of memory that R can use imposed by this particular OS build. When I type in the 'ulimit' command at the command line the response is 'unlimited'. Here is the problem: I have uploaded and normalized 48 ATH1 microarray slides using the justRMA function.>library("affy")>setwd("/Data/cel")>Data<-justRMA()The next step in my analysis is to calculate a distance matrix for my dataset using bioDist package. This is where I get my error.>library("bioDist")>x<-cor.dist(exprs(Data))Error: cannot allocate vector of size 3.9 Gb I used the following function to examine my memory limitations:> mem.limits()nsize vsize NA NA I believe this means there isn't any specified limit to the amount of memory R can allocate to my task. I realize I only have 3.8 Gb of RAM but I would expect that R would use my 1.9 Gb of swap. Does R not use my swap space? Can I explicitly tell R to use my swap space for large tasks such as this? I was not able to find any information regarding this particular issue in the R Linux manual, Linux FAQ, or on previous listserv threads. Many of the users who had similar questions resolved their problems in a different manner. Thanks to anyone who thinks they can provide assistance! Max Graduate Student Molecular Plant Sciences Washington State University [[alternative HTML version deleted]]
Peter Dalgaard
2007-Jul-19 08:19 UTC
[R] RAM, swap, Error: cannot allocate vector of size, Linux:
Feldman, Maximilian Jeffrey wrote:> Dear Community, > > I am very new to the world of Linux and R and I have stumbled upon a problem that I cannot seem to resolve on my own. Here is the relevant background: > > I am working on a 64-bit Linux Fedora Core 6 OS. I using R version 2.5.1. I have 3.8 Gb of RAM and 1.9 Gb of swap. As I see it, there are no restraints on the amount of memory that R can use imposed by this particular OS build. When I type in the 'ulimit' command at the command line the response is 'unlimited'. > > Here is the problem: > > I have uploaded and normalized 48 ATH1 microarray slides using the justRMA function. > > >> library("affy") >> > > >> setwd("/Data/cel") >> > > >> Data<-justRMA() >> > > The next step in my analysis is to calculate a distance matrix for my dataset using bioDist package. This is where I get my error. > > >> library("bioDist") >> > > >> x<-cor.dist(exprs(Data)) >> > > Error: cannot allocate vector of size 3.9 Gb > > I used the following function to examine my memory limitations: > > >> mem.limits() >> > > nsize vsize > > NA NA > > I believe this means there isn't any specified limit to the amount of memory R can allocate to my task. I realize I only have 3.8 Gb of RAM but I would expect that R would use my 1.9 Gb of swap. >It does, if swap works at all on your machine. However, the error message is relates to the object that R fails to create, not the total memory usage. I.e. this might very well be the _second_ object of size 3.9Gb that you are trying to fit into 5.7Gb of memory. You could try increasing the swap space (the expedient, although perhaps not efficient, way is to find a file system with a few tens of Gb to spare and create a large swapfile on it.)> Does R not use my swap space? Can I explicitly tell R to use my swap space for large tasks such as this? > > I was not able to find any information regarding this particular issue in the R Linux manual, Linux FAQ, or on previous listserv threads. Many of the users who had similar questions resolved their problems in a different manner. > > Thanks to anyone who thinks they can provide assistance! > > Max > > Graduate Student > > Molecular Plant Sciences > > Washington State University > > > [[alternative HTML version deleted]] > > ______________________________________________ > 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 > and provide commented, minimal, self-contained, reproducible code. >