#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      
------------------------+---------------------------------------------------
Changes (by SimonKing):

  * status:  needs_info => needs_review
  * work_issues:  avoid regression =>


Comment:

 Yesss!! It suffices (in addition to what I did before) to use a
 `TripleDictById` (which uses weak references to the keys, but strong
 references to the value) for `Parent._action_hash`!!!

 The leak is no completely gone:
 {{{
 sage: K = GF(1<<55,'t')
 sage: for i in range(50):
 ....:     a = K.random_element()
 ....:     E = EllipticCurve(j=a)
 ....:     P = E.random_point()
 ....:     Q = 2*P
 ....:
 sage: from sage.schemes.generic.homset import
 SchemeHomsetModule_abelian_variety_coordinates_field
 sage: import gc, objgraph
 sage: gc.collect()
 882
 sage: LE = [x for x in gc.get_objects() if
 isinstance(x,SchemeHomsetModule_abelian_variety_coordinates_field)]
 sage: len(LE)
 1
 }}}

 I need to add a test (or better: modify the test introduced by the first
 patch), demonstrating that the "big" leak is fixed, and I need to add
 tests for the new code I wrote, and of course I need to run ptestlong.

 Nevertheless, I think you can start reviewing. And please store the doc
 test times, so that we can detect any regression.

 Apply trac715_two_tripledicts.patch trac715_weak_action.patch

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