igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] Memory liberation Python...


From: Sergio Jiménez
Subject: [igraph] Memory liberation Python...
Date: Mon, 22 Sep 2008 16:44:07 +0200

Hello, 
I'm having memory liberation problems using the igraph library for Python.
I intend to do a community partition of a graph and and ploting each
community in a different image file.
The way I'm doing it is the following:

# Import graph, and calculate community structure
....

#ucomms=[] list of communities to plot 

for commid in ucomms:
    try:
        print "*** Creating community[%d] = %d -- %.2f s\n" \
              % (ucomms.index(commid),commid,time()-t0)
        # build comm subgraph
        comm_nodes = [ v for (v,c) in enumerate(g.vs["comm"]) if c ==commid]
        subg = g.subgraph(comm_nodes)    
        # prepare for drawing
        fig = igraph.Plot(bbox=(1024,768))
        fig.add(subg, layout="lgl", margin=(50,50,50,50))
        fig.save("Comm_%d.png" % commid)
          del subg
          del fig                
    except e:
        print "!!! ERROR generando PNG para comunidad %d (num.nodes=%d)" % (
commid, len([v for v in g.vs if v["comm"] == commid]))
        print e
print "Done."


But every time the subgraph method is called, memory is allocated for de
object and it's never liberated, even doing explicit del.
Finally the program exit with an out of memory error.

Is there any way to liberate this memory ??

Best regards 

                Sergio 


 

_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help
No virus found in this incoming message.
Checked by AVG - http://www.avg.com 
Version: 8.0.169 / Virus Database: 270.6.21/1671 - Release Date: 22/09/2008
6:39





reply via email to

[Prev in Thread] Current Thread [Next in Thread]