[R] Memory leak using Rgraphviz

From: Andreas Yankopolus <andreas_at_yank.to>
Date: Thu, 03 Jun 2010 15:13:40 -0700


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. Received on Thu 03 Jun 2010 - 22:16:21 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 - 22:40: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