#15424: A coercion-related memory leak
-----------------------------+-------------------------
       Reporter:  SimonKing  |        Owner:
           Type:  defect     |       Status:  new
       Priority:  major      |    Milestone:  sage-5.13
      Component:  memleak    |   Resolution:
       Keywords:             |    Merged in:
        Authors:             |    Reviewers:
Report Upstream:  N/A        |  Work issues:
         Branch:             |       Commit:
   Dependencies:             |     Stopgaps:
-----------------------------+-------------------------

Comment (by nbruin):

 OK, looking at the referrers to the TripleDict I get a
 sage.structure.coerce.CoercionModel_cache_maps
 `sage.structure.coerce.CoercionModel_cache_maps`, so I guess it's not a
 "global" cache but one stored on an object that has an awfully long
 lifespan.

 Correction: the values are either `None` or a pair of maps. So I guess the
 keys are not domain and codomain but parents of pairs of elements and the
 pair of maps are the ones that map into the common parent.

 So my guess is that this cache is used when determining a common parent
 and then stores the maps needed to get to that. It seems to me we can
 mitigate this leak considerably if we DON'T store the maps here if we find
 a coercion from one into the other would do the job: instead store a
 symbolic "coerce_to_first" or "coerce_to_second" value in there.

 In cases where there is a genuine third parent into which we're mapping,
 it's a little safer: then the codomain at least doesn't keep alive the
 keys. It's unclear to me how long we should be keeping the common
 overparent in that case. This cache will mean its life is bounded below by
 the shortest life time of the two "covered" parents.

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