#18905: fix more leaks found in #18897
---------------------------+------------------------
       Reporter:  dimpase  |        Owner:
           Type:  defect   |       Status:  new
       Priority:  major    |    Milestone:  sage-6.8
      Component:  memleak  |   Resolution:
       Keywords:           |    Merged in:
        Authors:           |    Reviewers:
Report Upstream:  N/A      |  Work issues:
         Branch:           |       Commit:
   Dependencies:  #18897   |     Stopgaps:
---------------------------+------------------------

Comment (by SimonKing):

 Aha. The coercion model caches the coerce maps, too. So, it isn't the
 codomain only that holds a cache.

 The coercion model is of course a permanent object. It references a
 `TripleDict` to store the coercion maps. The coercion map references the
 codomain. Hence, if the domain is strongly referenced from somewhere, then
 the coerce map and thus the codomain can not be garbage collected.

 Can we perhaps make it so that the cache in the coercion model only keeps
 a WEAK reference to the coerce map? I worry about performance, though,
 since getting the referenced object from a weak reference is a bit costly.

 Do we need to worry about premature collection of coerce map? If I
 understand correctly, the cache in the coercion model is mainly for
 performance, as the map is cached as an attribute of the codomain anyway.
 And the codomain of any map is a parent. Hence, the cache of the coercion
 model actually is redundant.

 So, perhaps a better idea is to completely get rid of the coercion model
 cache, as the coercion model can use the codomain's cache. I'll try that.

--
Ticket URL: <http://trac.sagemath.org/ticket/18905#comment:15>
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/d/optout.

Reply via email to