#14711: Memleak when creating QuadraticField
-------------------------------------------------+-------------------------
       Reporter:  jpflori                        |        Owner:
           Type:  defect                         |  davidloeffler
       Priority:  critical                       |       Status:  new
      Component:  number fields                  |    Milestone:  sage-5.12
       Keywords:  memleak, number field,         |   Resolution:
  QuadraticField                                 |    Merged in:
        Authors:                                 |    Reviewers:
Report Upstream:  N/A                            |  Work issues:
         Branch:                                 |       Commit:
   Dependencies:                                 |     Stopgaps:
-------------------------------------------------+-------------------------

Comment (by jpflori):

 Replying to [comment:16 SimonKing]:
 > Replying to [comment:14 SimonKing]:
 > > But if I recall correctly, there is further strong caching done for
 number fields.
 >
 > I stand corrected. There is
 `sage.rings.number_field.number_field._nf_cache`, which is a dictionary.
 But apparently it does use weak references to the values.
 >
 > However, I don't see why one shouldn't use a `WeakValueDictionary`
 instead.
 Me neither, unless someone has the habit to play frequently with the same
 number field but without keeping any of its elements alive between
 different uses, personally I don't and would not really see the point.

 If we switch to a weak value dict, we could also get rid of the cache
 argument of the constructor then which won't be that useful/sensible
 anymore.

--
Ticket URL: <http://trac.sagemath.org/ticket/14711#comment:17>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to