#5970: Weak references in Polynomial Ring cache
-----------------------------------+----------------------------------------
   Reporter:  SimonKing            |       Owner:  malb                         
       
       Type:  defect               |      Status:  needs_review                 
       
   Priority:  critical             |   Milestone:  sage-4.3.1                   
       
  Component:  commutative algebra  |    Keywords:  polynomial ring cache weak 
reference
Work_issues:                       |      Author:                               
       
   Upstream:  N/A                  |    Reviewer:                               
       
     Merged:                       |  
-----------------------------------+----------------------------------------

Comment(by SimonKing):

 This is not a review yet, but some first tests.

 There is some progress. Consider the following code snipped (slightly
 modifying Alex' code):
 {{{
 def test_poly_leak(upper):
     a = get_memory_usage()
     c = 0
     for p in prime_range(upper):
         c+=1
         R.<x, y, z> = PolynomialRing(GF(p), 3)
     b = get_memory_usage()
     return (b - a)/c
 }}}

 So, the average memory allocation for each created polynomial ring is
 counted.

 Result on sage.math:
 {{{
 sage: attach test.sage
 sage: test_poly_leak(100000)
 0.03225588380942452
 }}}
 which I can confirm on my computer with original 4.3.rc0.

 With the patch, one has
 {{{
 sage: attach test.sage
 sage: test_poly_leak(100000)
 0.0072749426605504585
 }}}

 I did not yet try to crash the patch intentionally. However, I did some
 indirect stress tests. Namely, I did some series of random examples of
 Symmetric Groebner bases (this is about infinite polynomial rings, see
 #7580). Here, many ''finite'' polynomial rings are created. There was no
 segfault or so, which I take as a good sign.

 So long,

 Simon

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