#12313: Fix yet another memory leak caused by caching of coercion data
--------------------------------------------------+-------------------------
       Reporter:  SimonKing                       |         Owner:              
                             
           Type:  defect                          |        Status:  
needs_review                             
       Priority:  major                           |     Milestone:  sage-5.3    
                             
      Component:  memleak                         |    Resolution:              
                             
       Keywords:  coercion weak dictionary        |   Work issues:              
                             
Report Upstream:  N/A                             |     Reviewers:  Simon King, 
Jean-Pierre Flori, John Perry
        Authors:  Simon King, Jean-Pierre Flori   |     Merged in:              
                             
   Dependencies:  #11521, #11599, #12969, #12215  |      Stopgaps:              
                             
--------------------------------------------------+-------------------------

Comment (by nbruin):

 Too bad ... We never did positively confirm that the problem here was some
 method on a key getting '''called'''. The patch doesn't help for the
 polybori problem. I suspect it really is a double memory release somewhere
 that simply didn't ever occur before because the memory didn't get
 released in the first place? (perhaps python doesn't deallocate all memory
 upon exit? why would they?

 I don't think a more fancy implementation of a safeweakvaluedict would
 work either. By keeping references to all keys while *clearing* the
 dictionary (that's just the clear that's inherited on dict), I think we
 are avoiding all calls to keys. Purging a dict doesn't involve key lookups
 and deleting the keys afterwards is just that. That should be possible. By
 then we're not holding weakrefs on them anymore, so no callbacks.

 So, while I still think the current `WeakValueDict` design has a silly
 callback, the only problem with it that we have actually observed can be
 solved with a well-timed `gc.collect()`.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12313#comment:220>
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