#715: Parents probably not reclaimed due to too much caching
------------------------+---------------------------------------------------
   Reporter:  robertwb  |          Owner:  somebody           
       Type:  defect    |         Status:  needs_review       
   Priority:  major     |      Milestone:  sage-4.8           
  Component:  coercion  |       Keywords:  weak cache coercion
Work_issues:            |       Upstream:  N/A                
   Reviewer:            |         Author:  Simon King         
     Merged:            |   Dependencies:  #9138, #11900      
------------------------+---------------------------------------------------

Comment(by SimonKing):

 I found another memory leak:
 {{{
 sage: K = GF(1<<55,'t')
 sage: for i in range(50):
 ....:     a = K.random_element()
 ....:     E = EllipticCurve(j=a)
 ....:     b = K.has_coerce_map_from(E)
 ....:
 sage: import gc
 sage: gc.collect()
 0
 }}}

 Namely, `K.coerce_map_from(E)` stores the resulting map (or None) in a
 strong dictionary.

 Several questions: Would it suffice to change the dictionary into a
 `WeakKeyDictionary`? If it would: Would it cause a regression? I guess the
 answer to the second question is "yes", since getting an item out of a
 weak key dictionary is quite slow and requesting a coerce map is a very
 frequent operation.

 So, I suppose one could introduce another type of dictionary, analogous to
 `TripleDict`, which would not test for equality but for identity.

 But should this be here or on a new ticket? I think the patch from here is
 big enough, hence, do it on a different ticket, but you can try to
 convince me to do it here.

 Since the patchbot tried to use the wrong patches:

 Apply trac715_one_tripledict.patch

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