igraph / xdata-igraph

xdata igraph, has been merged into igraph/igraph
GNU General Public License v2.0
18 stars 3 forks source link

possible memory leaking on "adjacency.spectral.embedding"? #21

Closed youngser closed 10 years ago

youngser commented 10 years ago

This is from a colleague:

Try the following code. The print statements make it seem that the memory is being freed and is stable, but if you do a top you'll see that the R process is using an increasing amount of memory and eventually (if you run the code long enough) you'll run out of memory and crash. This is using the code I have, not the one you included, I haven't tested that yet.

require(igraph)

P <- rbind(
c(0.02,0.02,0.006666667,0.00,0.02,0.04,0.04,0.02),
c(0.02,0.00,0.006666667,0.02,0.00,0.00,0.00,0.00),
c(0.02,0.00,0.006666667,0.00,0.00,0.00,0.00,0.00),
c(0.02,0.00,0.006666667,0.02,0.00,0.00,0.00,0.00),
c(0.02,0.02,0.006666667,0.00,0.02,0.00,0.00,0.00),
c(0.00,0.00,0.00       ,0.00,0.00,0.04,0.04,0.02),
c(0.04,0.00,0.013333333,0.04,0.00,0.02,0.02,0.01),
c(0.00,0.00,0.00       ,0.00,0.00,0.02,0.02,0.01))

groups <- c(15768,4000,1000,3000,2000,2500,2500,2000)/4

g <- sbm.game(sum(groups),P,groups,directed=TRUE)
for(i in 1:500){
    x <- adjacency.spectral.embedding(g,no=4)
    rm(x)
    print(gc())
}
gaborcsardi commented 10 years ago

Indeed, fixed!