[Rd] Memory leak in read.table (PR#1292)

ford@signal.qinetiq.com ford@signal.qinetiq.com
Fri, 1 Feb 2002 12:37:18 +0100 (MET)


Full_Name: Ashley Ford
Version: 1.4.0
OS: Windows NT4
Submission from: (NULL) (146.80.9.20)


I am suffering from a memory leak in read.table in the new precompiled windows
1.4.
it works fine in 1.3

Create a 90000 line file of 7 variables eg
perl -e '$e=exp(1);for($i=0;$i<90000;$i++){printf "%d".(" %f"x6)."\n",
$i,$i*$e,3,4,5,6,7,8,9}' > n90000

R : Copyright 2001, The R Development Core Team
Version 1.4.0  (2001-12-19)

n9<-read.table("n90000")
Error: cannot allocate vector of size 75 Kb
In addition: Warning message: 
Reached total allocation of 63Mb: see help(memory.size) 
> gc()
         used (Mb) gc trigger (Mb)
Ncells 206781  5.6     467875 12.5
Vcells 109631  0.9     786432  6.0

On a machine with 512Mb it takes over 10 minutes before running out of memory

On Version 1.3.1  (2001-08-31)
it works fine 
date();n9<-read.table("n90000");date();str(n9)
[1] "Tue Jan 29 20:41:30 2002"
[1] "Tue Jan 29 20:43:29 2002"
`data.frame':   90000 obs. of  7 variables:
 $ V1: num  2 3 4 5 6 7 8 9 10 11 ...
 $ V2: num   5.44  8.15 10.87 13.59 16.31 ...
 $ V3: num  3 3 3 3 3 3 3 3 3 3 ...
 $ V4: num  4 4 4 4 4 4 4 4 4 4 ...
 $ V5: num  5 5 5 5 5 5 5 5 5 5 ...
 $ V6: num  6 6 6 6 6 6 6 6 6 6 ...
 $ V7: num  7 7 7 7 7 7 7 7 7 7 ...
> gc()
         used (Mb) gc trigger (Mb)
Ncells 278967  7.5     984024 26.3
Vcells 801283  6.2    2620390 20.0

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._