#12313: Fix yet another memory leak caused by caching of coercion data
--------------------------------------------------+-------------------------
       Reporter:  SimonKing                       |         Owner:              
                                                        
           Type:  defect                          |        Status:  
needs_review                                                        
       Priority:  major                           |     Milestone:  sage-5.3    
                                                        
      Component:  memleak                         |    Resolution:              
                                                        
       Keywords:  coercion weak dictionary        |   Work issues:  Rebase wrt 
the new version of #715. Take into account Nils' comments
Report Upstream:  N/A                             |     Reviewers:  Simon King, 
Jean-Pierre Flori, John Perry                           
        Authors:  Simon King, Jean-Pierre Flori   |     Merged in:              
                                                        
   Dependencies:  #11521, #11599, #12969, #12215  |      Stopgaps:              
                                                        
--------------------------------------------------+-------------------------

Comment (by nbruin):

 Both these work fine for me on a pristine 5.3b2 with the patches for this
 ticket applied:
 {{{
         sage -t  -force_lib
 devel/sage-12313/sage/rings/padics/padic_base_leaves.py # 1 doctests
 failed
         sage -t  -force_lib
 devel/sage-12313/sage/rings/polynomial/infinite_polynomial_element.py #
 Killed/crashed
 }}}
 See also #13370, where Simon can reproduce the padic_base_leaves failure.

 I tried the following code to try and recreate the circumstances Simon
 finds there, but no problem occurs (it does usually succeed fairly quickly
 in finding R with the same id as the K before)
 {{{
 import gc
 while True:
   k=Qp(7)
   L=[c^2 for c in range(2^randint(1,15))] #to stir up memory use
   print id(k)
   K=Qp(7,40)
   iK = id(K)
   assert k.has_coerce_map_from(K) is False
   del K
   gc.collect()
   R=Zp(7,40)
   iR = id(R)
   if iR == iK:
       break
   del k,R
   gc.collect()

 assert k.has_coerce_map_from(R)
 }}}

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