Is it already known that R does not free the memory that it allocates during start-up (~10MB) when it exits? If so, are there currently any plans to address this problem? I noticed that the 1.6.0 beta leaks slightly more memory (~300k) than the 1.5.1 stable version. I am working on a project that links with the R library, and there is a question about unloading and later re-loading the R library, so this memory leak could become a real issue. Thank you. David Bauer -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> > Is it already known that R does not free the memory that it allocates > >during start-up (~10MB) when it exits? If so, are there currently any > >plans to address this problem? I noticed that the 1.6.0 beta leaks > >slightly more memory (~300k) than the 1.5.1 stable version. > >I don't think this is known. > >What platform are you on, and how are you measuring the leak? On >Windows, it is not the responsibility of an application to release its >memory, that's the responsibility of the OS, so if the problem is >happening there, you should be talking to Microsoft (or questioning >how you measured it).Working on a Linux box, I originally found the leak using a memory management program that I wrote. I confirmed the leak using the Valgrind program (http://developer.kde.org/~sewardj/), which produces a nice output. If you would like, I can post a full or edited output from that program. The majority of the memory is allocated using the GetNewPage function in memory.c and appears to still be in the table of allocated pages when R exits. David Bauer -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Note that this about initialisation of the R shared library R.so, not the R executable. This may need fixing -- with a standalone executable the operating system will handle memory release when the program exits, but with an R library dynamically loaded into another process it won't. OTOH, why do you want to load and unload R lots of times? -thomas On Wed, 11 Sep 2002, David Bauer wrote:> Is it already known that R does not free the memory that it allocates > during start-up (~10MB) when it exits? If so, are there currently any > plans to address this problem? I noticed that the 1.6.0 beta leaks > slightly more memory (~300k) than the 1.5.1 stable version. > > I am working on a project that links with the R library, and there is a > question about unloading and later re-loading the R library, so this memory > leak could become a real issue.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._