Hello,
there is a memory leak when using shortest_paths algorithm.
library(igraph)
iterations <- 1000
g <- make_tree(n = 5000, children = 3, mode = "out")
for (i in 1:length(V(g))) { V(g)[i]$name <- ifelse(i %% 10 == 0, "home", "away")}
for (i in 1:length(E(g))) { E(g)[i]$weight <- as.integer(runif(1, 1, 10)) }
print(sum(gc()[,4]))
for (i in 1:iterations) {
if (i %% 100 == 0) print(sum(gc()[,4]))
sp <- shortest_paths(g, from = 3, to = V(g)[name == "home"],
mode="out", output="vpath", weights = E(g)$weight)
}
The memory used by the R session is displayed after every 100 calls to shortest_paths. It increases more or less steadily. When using smaller graphs it takes more iterations to make the increase obvious. I tested it on ArchLinux and Windows using igraph 1.1.2.
I came across this issue in a lager simulation and there I ended up with an R session using 3GB while all objects within the R session just needed 5MB. After drilling down I found out that the calls to shortest_paths caused the memory leaks.
Hello,
there is a memory leak when using shortest_paths algorithm.
The memory used by the R session is displayed after every 100 calls to shortest_paths. It increases more or less steadily. When using smaller graphs it takes more iterations to make the increase obvious. I tested it on ArchLinux and Windows using igraph 1.1.2.
I came across this issue in a lager simulation and there I ended up with an R session using 3GB while all objects within the R session just needed 5MB. After drilling down I found out that the calls to shortest_paths caused the memory leaks.