[Rd] Memory "leak" in readChar (PR#1483)

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
26 Apr 2002 11:48:46 +0200

hcp@met.ed.ac.uk writes:

> Full_Name: Hugh C. Pumphrey
> Version: 1.4.1
> OS: Linux (Debian Woody)
> Submission from: (NULL) (
> The function readChar() appears to have some type of problem with memory
> allocation.
> I don't know if "memory leak" is the correct term but if one uses readChar()
> many
> times, the R binary grows in size until it eats all your memory and swap space.
> The code enclosed below demonstrates the problem. As-is, it causes the size
> of R.bin to grow from 11MB to 50MB, even though there are no large arrays. 
> The old Rstreams package did not do this. Also, the function readBin() does
> not suffer from this problem.

Still there in a recent pre-1.5.0 looks like a bunch of Vcells is
allocated but remains protected from garbage collection.

I doubt that this is something we'd dare try and fix before the
release on Monday though.

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
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