#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 SimonKing):
Clearing this cache doesn't help anyway:
{{{
sage: Q = QuadraticField(-3)
sage: import weakref
sage: import gc
sage: gc.collect()
524
sage: C = Q.__class__.__base__
sage: len([x for x in gc.get_objects() if isinstance(x, C)])
3
sage: del Q
sage: gc.collect()
0
sage: len([x for x in gc.get_objects() if isinstance(x, C)])
3
sage: sage.rings.number_field.number_field._nf_cache.clear()
sage: gc.collect()
0
sage: len([x for x in gc.get_objects() if isinstance(x, C)])
3
}}}
Even worse, with the change proposed above, one actually has an empty
`_convert_from_list` for CDF, but nevertheless the quadratic number field
does not want to die:
{{{
sage: CDF._introspect_coerce()
{'_action_hash': <sage.structure.coerce_dict.TripleDict at 0x95264c4>,
'_action_list': [],
'_coerce_from_hash': <sage.structure.coerce_dict.MonoDict at 0x952656c>,
'_coerce_from_list': [],
'_convert_from_hash': <sage.structure.coerce_dict.MonoDict at 0x9526534>,
'_convert_from_list': [],
'_element_init_pass_parent': False,
'_embedding': None,
'_initial_action_list': [],
'_initial_coerce_list': [],
'_initial_convert_list': []}
}}}
Hence, there must be another strong reference somewhere.
--
Ticket URL: <http://trac.sagemath.org/ticket/14711#comment:18>
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.