From murdoch@stats.uwo.ca  Thu Sep 12 16:31:03 2002
From: murdoch@stats.uwo.ca (Duncan Murdoch)
Date: Thu, 12 Sep 2002 11:31:03 -0400
Subject: Startup/Initialization Memory Leak in R
In-Reply-To: <Pine.A41.4.44.0209120738510.155470-100000@homer34.u.washington.edu>
References: <5.1.1.5.2.20020911210204.00ac4270@pop.prism.gatech.edu> <Pine.A41.4.44.0209120738510.155470-100000@homer34.u.washington.edu>
Message-ID: <sec1ouosn77a9bh5p0u8ir1ndm6qhg8jki@4ax.com>

On Thu, 12 Sep 2002 07:42:09 -0700 (PDT), you wrote in message
<Pine.A41.4.44.0209120738510.155470-100000@homer34.u.washington.edu>:

>
>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?

I misunderstood the context.  The same problem would likely occur in
Windows if your application uses R.dll.

I agree that this should be fixed in the long term:  one might want to
instantiate multiple copies of R's evaluator in some application (e.g.
a new front-end that ran multiple consoles), and there should be a way
to shut them down and clean up afterwards.  In the meantime, the
workaround is probably to just keep a list of the activated copies,
and when a new one is needed, check if there's an unused one in the
list.  If so, execute some code to clean up the environment, and
re-use it.

Duncan Murdoch
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


Startup/Initialization Memory Leak in R
Duncan Murdoch