From abergeron at gmail.com  Tue Apr 15 02:15:08 2008
From: abergeron at gmail.com (abergeron at gmail.com)
Date: Tue, 15 Apr 2008 02:15:08 +0200 (CEST)
Subject: [Rd] Small memory leak in plot on OS X (PR#11170)
Message-ID: <20080415001508.A294A282EF48@mail.pubhealth.ku.dk>

Full_Name: Arnaud Bergeron
Version: 2.6.2
OS: Mac OS X 10.5.2
Submission from: (NULL) (69.157.224.197)


When I run the following loop

repeat { plot(seq(5), seq(5)) }

the memory consumed by the process goes up by a small amout each time. I tried
this with the quartz() and pdf() output devices.  Only a single output device is
created by the process and is repeatedly overwritten by plot().

Also even if I close the device with dev.off() the memory is never released,
even after a gc() pass.  In fact the gc() pass reports way less memory used than
what the system reports.  I can understand a discrepancy in the numbers here,
but 9.1Mb (reported by gc()) versus 415Mb (reported by the system) is not normal
in my eyes.

With the png() device, the results were less conclusive. I'd say there was a
slight overall augmentation of used memory, but may that's just me.  Note that
this device creates many files by default and the problem does not seem to
happen when it does this.

Below is the sessionInfo() output:

R version 2.6.2 (2008-02-08) 
powerpc-apple-darwin8.10.1 

locale:
fr_CA.UTF-8/fr_CA.UTF-8/fr_CA.UTF-8/C/fr_CA.UTF-8/fr_CA.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base



[Rd] Small memory leak in plot on OS X (PR#11170)
abergeron at gmail.com