Dear list,

I'm a quite new user of R-project, and I've a doubt on objects memory: I open a 
new R session and the command memory.limits() gives me 1535 Mb of memory (the 
PC has 2 Gb RAM and 32 bit), I create an integer vector object of 2e8 size, so 
about 2e8*4 bytes (800Mb) of memory are allocated, a size smaller then memory 
available. But when I try to make the dataframe of this object it gives me 
"Errore: cannot allocate vector of size 762.9 Mb".
Why cannot I create a dataframe of an object with size smaller then memory 
available?
I also tried to halve the object size but the situation doesn't changes.
In R, is the memory of dataframe object smaller then vector object one?
Are there different memory limits between objects? Is there a possibility to
 change limits?
This is the command sequence:

R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i386-pc-mingw32/i386 (32-bit)


> ls()
character(0)
> memory.limit()
[1] 1535
> x=integer(2e8)
> object.size(x)
800000024 bytes
> rm(x)
> ls()
character(0)
> x=data.frame(integer(2e8))
Errore: cannot allocate vector of size 762.9 Mb
Inoltre: Warning messages:
1: In as.data.frame.integer(x[[i]], optional
 = TRUE) :
  Reached total allocation of 1535Mb: see help(memory.size)
2: In as.data.frame.integer(x[[i]], optional = TRUE) :
  Reached total allocation of 1535Mb: see help(memory.size)
3: In as.data.frame.integer(x[[i]], optional = TRUE) :
  Reached total allocation of 1535Mb: see help(memory.size)
4: In as.data.frame.integer(x[[i]], optional = TRUE) :
  Reached total allocation of 1535Mb: see help(memory.size)
> x=data.frame(integer(1e8))
Errore: cannot allocate vector of size 381.5 Mb
Inoltre: Warning messages:
1: In unlist(vlist, recursive = FALSE, use.names = FALSE) :
  Reached total allocation of 1535Mb: see help(memory.size)
2: In unlist(vlist, recursive = FALSE, use.names = FALSE) :
  Reached total allocation of 1535Mb: see help(memory.size)
3: In unlist(vlist, recursive = FALSE, use.names = FALSE) :
  Reached total allocation of 1535Mb: see help(memory.size)
4: In unlist(vlist, recursive =
 FALSE, use.names = FALSE) :
  Reached total allocation of 1535Mb: see help(memory.size)
> Many thanks. Kind regards.
Dr. Francesca Bader
University of Trieste
Italy





      
        [[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.

Reply via email to