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

Comment(by SimonKing):

 There are two occasions for writing stuff into `Parent._action_hash`:
 During initialisation, via register_action, and in addition the action is
 stored in the parent when a new action is found while calling get_action.

 Perhaps we should distinguish the two cases: The actions that are stored
 during initialisation should probably be "immortal". But the actions that
 is stored on the fly should only be weakly cached.

 I think this can be solved by changing `Parent._action_hash` into a
 dictionary that uses weak references to both the keys and the values.
 There is one difference between register_action and get_action:
 register_action additionally stores the actions in a list, but get_action
 doesn't. Hence, indeed the actions registered during initialisation will
 survive, but the stuff stored by get_action could become collectable.

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