#11521: Memleak when resolving the action of Integers on an Elliptic Curve
------------------------+---------------------------------------------------
   Reporter:  jpflori   |          Owner:  robertwb    
       Type:  defect    |         Status:  needs_review
   Priority:  major     |      Milestone:  sage-4.8    
  Component:  coercion  |       Keywords:  sd35        
Work_issues:            |       Upstream:  N/A         
   Reviewer:            |         Author:  Simon King  
     Merged:            |   Dependencies:  #11900 #715 
------------------------+---------------------------------------------------
Changes (by SimonKing):

  * status:  needs_work => needs_review
  * dependencies:  #11900 => #11900 #715
  * work_issues:  Understand why a weak key dictionary is not enough =>


Old description:

> The following piece of code leaks memory. [[BR]] [[BR]] sage: K =
> GF(1<<55,'t') [[BR]] sage: a = K.random_element() [[BR]] sage: while 1:
> [[BR]] ....:     E = !EllipticCurve(j=a); P = E.random_point(); 2*P;
>
> The problem seems to occur while resolving the action of ZZ on E.
>
> It does not happen if:
>
> - one does not change the curve in the loop
>
> - does P+P instead of a multiplication

New description:

 The following piece of code leaks memory. [[BR]] [[BR]] sage: K =
 GF(1<<55,'t') [[BR]] sage: a = K.random_element() [[BR]] sage: while 1:
 [[BR]] ....:     E = !EllipticCurve(j=a); P = E.random_point(); 2*P;

 The problem seems to occur while resolving the action of ZZ on E.

 It does not happen if:

 - one does not change the curve in the loop

 - does P+P instead of a multiplication

 '''Apply'''

 [attachment:trac11521_triple_homset.patch]

--

Comment:

 I have attached another patch under a new name, using a new approach: The
 weak `TripleDict`, that I introduce at #715, is an appropriate tool for
 the cache of homsets. The key is the triple `(domain, codomain,
 category)`, and the value is a weak reference to the corresponding homset.

 There is a new test (the same as in the other patch), showing that the
 leak is fixed. And all tests in sage/schemes, sage/rings, sage/categories
 and sage/structure pass.

 Hence: Needs review!

 Apply trac11521_triple_homset.patch

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