On Wednesday, July 3, 2013 2:32:14 PM UTC+2, Nathann Cohen wrote: > > Helloooooooo everybody !!! > > There is a very ugly memory leak in Sage's graphs, and I have no idea of > how it should be hunted. It is (unfortunately) very easy to produce : > > sage: get_memory_usage() > 956.87890625 > sage: graphs.CompleteGraph(700) > Complete graph: Graph on 700 vertices > sage: get_memory_usage() > 1087.76953125 > sage: import gc > sage: gc.collect() > 0 > sage: get_memory_usage() > 1087.76953125 >
This is not evidence of a memory leak. The sage shell remembers some previous results, so by simply calling graphs.CompleteGraph(700) you are forcing sage to keep the object alive for some time. No leak. You should probably try something like def test(): dummy=graphs.CompleteGraph(700) return 1 and then sage: test() sage: test() sage: test() sage: gc.collect() sage: <filter gc.get_objects() in some way to see what kind of objects are remaining on the heap that you think should be collected.> Once you have located some of those objects, you can use gc.get_referrers on them to see who is keeping references. Or perhaps you'll find there's no leak at all. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/groups/opt_out.
