Roger D. Peng
2003-Dec-17 20:30 UTC
[Rd] negative numbers from object.size() on 64 bit systems
Has anyone running R 1.8.1 on a 64 bit system gotten negative numbers from object.size() on objects > 2GB or so? For example, on Solaris/Sparc I get > b <- numeric(131072 * 2800) > object.size(b) [1] -1358954440 I get similar behavior on the Opteron (SuSE Linux). I'm not sure if this is an R problem or something wrong with the way it was compiled on either system. I noticed in objectsize() in size.c, the `cnt' variable is an int, which I guess would max out at 2^31. Might this be the problem? Any hints would be appreciated. Thanks, -roger
w.huber@dkfz-heidelberg.de
2003-Dec-17 20:43 UTC
[Rd] negative numbers from object.size() on 64 bit systems
Hi, same behavior on this machine:> b <- numeric(131072 * 2800) > object.size(b)[1] -1358954440> version_ platform alphaev68-dec-osf4.0f arch alphaev68 os osf4.0f system alphaev68, osf4.0f status major 1 minor 8.0 year 2003 month 10 day 08 language R ------------------------------------- Wolfgang Huber Division of Molecular Genome Analysis German Cancer Research Center Heidelberg, Germany Phone: +49 6221 424709 Fax: +49 6221 42524709 Http: www.dkfz.de/abt0840/whuber ------------------------------------- On Wed, 17 Dec 2003, Roger D. Peng wrote:> Has anyone running R 1.8.1 on a 64 bit system gotten negative numbers > from object.size() on objects > 2GB or so? For example, on > Solaris/Sparc I get > > > b <- numeric(131072 * 2800) > > object.size(b) > [1] -1358954440 > > I get similar behavior on the Opteron (SuSE Linux). I'm not sure if > this is an R problem or something wrong with the way it was compiled on > either system. > > I noticed in objectsize() in size.c, the `cnt' variable is an int, which > I guess would max out at 2^31. Might this be the problem? Any hints > would be appreciated. > > Thanks, > > -roger
Prof Brian Ripley
2003-Dec-17 20:46 UTC
[Rd] negative numbers from object.size() on 64 bit systems
On Wed, 17 Dec 2003, Roger D. Peng wrote:> Has anyone running R 1.8.1 on a 64 bit system gotten negative numbers > from object.size() on objects > 2GB or so? For example, on > Solaris/Sparc I get > > > b <- numeric(131072 * 2800) > > object.size(b) > [1] -1358954440 > > I get similar behavior on the Opteron (SuSE Linux). I'm not sure if > this is an R problem or something wrong with the way it was compiled on > either system. > > I noticed in objectsize() in size.c, the `cnt' variable is an int, which > I guess would max out at 2^31. Might this be the problem? Any hints > would be appreciated.Yes, and so is objectsize, and the return type is integer. At the time that was written R could not use more than 2Gb. I've modified the function but have no machine with more than 2Gb to test it on, so could you please try R-devel in a couple of days? -- Brian D. Ripley, ripley@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