#15498: Memory leak in ideal arithmetic
-------------------------------+------------------------
       Reporter:  ppurka       |        Owner:
           Type:  defect       |       Status:  new
       Priority:  major        |    Milestone:  sage-6.1
      Component:  algebra      |   Resolution:
       Keywords:  memory leak  |    Merged in:
        Authors:               |    Reviewers:
Report Upstream:  N/A          |  Work issues:
         Branch:               |       Commit:
   Dependencies:               |     Stopgaps:
-------------------------------+------------------------

Comment (by nbruin):

 Memory use is still increasing with 5.13.xx, but I don't see a particular
 object count go up in the way one would expect with a straight memory
 leak. This could just be fragmentation or some other difficult-to-control
 issue. The code I tried was:
 {{{
 sage: sage: import gc
 sage: sage: from collections import Counter
 sage: sage: R=QQ['x']
 sage: sage: R.ideal(1)==R.ideal(1)
 True
 sage: sage: gc.collect()
 514
 sage: sage: pre = gc.get_objects()
 sage: sage: for i in range(100000): _ = R.ideal(1) == R.ideal(1)
 sage: sage: gc.collect()
 0
 sage: sage: post = gc.get_objects()
 sage: sage: pre_id=set( id(p) for p in pre )
 sage: sage: new=[p for p in post if id(p) not in pre_id]
 sage: sage: C=Counter(type(p) for p in new)
 sage: sage: len(new)
 51
 sage: sage: len(pre)-len(post)+len(new)
 6
 sage: C
 Counter({<type 'list'>: 12, <type 'tuple'>: 8, <type 'dict'>: 7, <type
 'frame'>: 6, <type 'instancemethod'>: 4, <type 'weakref'>: 3, <class
 '_ast.Name'>: 2, <class '_ast.Interactive'>: 1, <type 'dictionary-
 itemiterator'>: 1, <class '_ast.Assign'>: 1, <type 'listiterator'>: 1,
 <class '_ast.Module'>: 1, <class '_ast.Attribute'>: 1, <type
 'builtin_function_or_method'>: 1, <type 'enumerate'>: 1, <class
 '_ast.Call'>: 1})
 }}}
 Hopefully the memory use flattens out after a while. It may well be that
 there was a serious leak for this example before that is now fixed. It may
 also be that we really are leaking, but not in python memory. Perhaps
 libsingular?

--
Ticket URL: <http://trac.sagemath.org/ticket/15498#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

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

Reply via email to