#5970: Weak references in Polynomial Ring cache
--------------------------------------------+-------------------------------
   Reporter:  SimonKing                     |          Owner:  malb             
                   
       Type:  defect                        |         Status:  needs_work       
                   
   Priority:  critical                      |      Milestone:  sage-4.8         
                   
  Component:  commutative algebra           |       Keywords:  polynomial ring 
cache weak reference
Work_issues:  regression for test_ec_leak?  |       Upstream:  N/A              
                   
   Reviewer:                                |         Author:                   
                   
     Merged:                                |   Dependencies:                   
                   
--------------------------------------------+-------------------------------
Changes (by SimonKing):

 * cc: vbraun (added)


Comment:

 I wonder why the example leaks, though. With the patches from #11521 and a
 not-yet-published patch for #715, I obtain:
 {{{
 sage: import gc
 sage: from sage.rings.finite_rings.finite_field_base import is_FiniteField
 sage: K = GF(151)
 sage: predicate = lambda x: is_FiniteField(x) and x.order() == 151
 sage: del K
 sage: gc.collect()
 174
 sage: [bla for bla in gc.get_objects() if predicate(bla)]
 []
 }}}

 So, prime fields do not seem to leak.
 {{{
 sage: from sage.rings.polynomial.multi_polynomial_ring import
 is_MPolynomialRing
 sage: K = GF(151)
 sage: P = K['x','y','z']
 sage: del P
 sage: gc.collect()
 33
 sage: predicate = lambda x: is_MPolynomialRing(x) and
 x.variable_names()==['x','y','z'] and x.base_ring() is K
 sage: [bla for bla in gc.get_objects() if predicate(bla)]
 []
 }}}

 So, where does the leak come from??? The example from the ticket
 description does use polynomial rings over finite prime fields!

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