Re: [R] Memory leak using Rgraphviz

From: Andreas Yankopolus <andreas_at_yank.to>
Date: Thu, 03 Jun 2010 18:37:09 -0400

I should have mentioned in my initial email: running gc() doesn't help.

You can run something like the following and watch memory usage soar:

for (ii in 1:10000) {

   foo()
   gc()
}

Thanks,

Andreas

On Jun 3, 2010, at 18:24, Corey Dow-Hygelund wrote:

> It appears you are facing a garbage collection issue.
>
> ?gc
>
> Corey
>
> On Thu, Jun 3, 2010 at 3:13 PM, Andreas Yankopolus <andreas_at_yank.to> wrote:
> I'm running an Ubuntu 10.04 system and installed R 2.10.1 through the package manger. I then installed Rgraphviz 1.24 and graph 1.26 through R.
>
> I'm trying to understand why a complex function my team wrote causes R's memory footprint viewed through top to increase every time it's run. I traced the increase in memory usage to layoutGraph() and wrote the following short function that reproduces the problem:
>
> foo <- function () {
> library(Rgraphviz)
> set.seed(123)
> V <- letters[1:26]
> M <- 1:2
> g1 <- randomGraph(V, M, 0.5)
> edgemode(g1) <- "directed"
> x <- layoutGraph(g1,name="foo",layoutType="twopi", recipEdges="distinct")
> }
>
> I expected that any memory allocated by this function would be freed when it returns, but that's not the case. Is there something that I need to be doing to to clean up after using layoutGraph?
>
> Thanks,
>
> Andreas
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 03 Jun 2010 - 22:39:44 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 03 Jun 2010 - 23:30:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive