On Wednesday, November 26, 2014 6:19:09 AM UTC-8, [email protected] wrote:
 

> Now, it seems that this eats memory. I guess that is because of 
> UniqueRepresentation that Poset inherits. This is not a problem when n=9, 
> it is irritating when n=10 and makes computing impossible when n=11. 
>

It may be in your function f, because I don't think this leaks by itself:

import gc
from collections import Counter
gc.collect()

pre={id(a) for a in gc.get_objects()}

for P in Posets(7):
   pass
   
gc.collect()

post=Counter(str(type(a)) for a in gc.get_objects() if id(a) not in pre)
post

doesn't report any object  with multiplicity 2045 or more (the length of 
Posets(7)), so it seems to me everything is getting collected. But see 
http://trac.sagemath.org/ticket/14356 for the kind of issue you might be 
running into. 

It's easy to create memory leaks yourself in the parts of sage that do have 
proper memory management. On top of that, there are plenty of genuine 
memory leaks in sage too. It can be tricky to find out which is happening 
for you, but you're taking the right approach.

Look at the python objgraph package, in particular  objgraph.show_backrefs, 
for a visual tool to help find the source of memory leaks. You have to be 
careful interpreting get_memory_usage statistics. Usually only 
considerable, sustained growth is indicative of a problem.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" 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-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to