#12357: Make groupoids garbage collectable
------------------------------------------------+---------------------------
       Reporter:  SimonKing                     |         Owner:  rlm           
   
           Type:  defect                        |        Status:  needs_work    
   
       Priority:  major                         |     Milestone:  sage-pending  
   
      Component:  memleak                       |    Resolution:                
   
       Keywords:  groupoid cache Cernay2012     |   Work issues:                
   
Report Upstream:  N/A                           |     Reviewers:  Jean-Pierre 
Flori
        Authors:  Simon King                    |     Merged in:                
   
   Dependencies:  #715, #11521, #12313, #11943  |      Stopgaps:                
   
------------------------------------------------+---------------------------

Comment (by SimonKing):

 Perhaps I should use a test that avoids polynomial rings, but uses a
 custom `UniqueRepresentation`. Namely, #12215 makes `UniqueRepresentation`
 collectable, and the patch from here makes the groupoid collectable as
 well, namely:
 {{{
 sage: class MyParent(UniqueRepresentation, Parent):
 ....:     pass
 ....:
 sage: P = MyParent()
 sage: import gc
 sage: m = id(P)
 sage: n = id(Groupoid(P))
 sage: m in map(id, gc.get_objects())
 True
 sage: n in map(id, gc.get_objects())
 True
 sage: del P
 sage: _ = gc.collect()
 sage: m in map(id, gc.get_objects())
 False
 sage: n in map(id, gc.get_objects())
 False
 }}}

 What do you think?

 By the way, the timeout is no problem: I had closed my laptop during the
 tests. Hence, the tests were interrupted, but the time was running.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12357#comment:25>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to