#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: u/SimonKing/ticket/14711 | Commit:
Dependencies: | Stopgaps:
-------------------------------------------------+-------------------------
Comment (by SimonKing):
I think we'd need to do more: phi has a strong reference to the homset
`phi.parent()`, which also has strong references to both D and C.
Perhaps we could make it so that homsets ''always'' only keep weak
references to domain and codomain, whereas maps (such as phi) by default
keep ''strong'' references to domain and codomain, but have a method
'phi._make_references_weak()` that makes them have weak references to
domain and codomain?
Rationale: I hope it is very unlikely that we have a homset, but don't
created an element of it and don't keep references to domain or codomain.
Hence, I hope it is acceptable that in such situation the domain and
codomain of the homset may be garbage collected. But if we have a
morphism, then this morphism will keep the domain and codomain alive, and
thus weak references of the homset don't hurt. And the exception is: If
this morphism is used for coercion, then we can call
`_make_references_weak()` on it, so that domain and/or codomain need an
external reference to prevent garbage collection.
Hmm. I guess it isn't very clear yet. Perhaps it is best to try and
provide a proof of concept, sometimes in the next days.
--
Ticket URL: <http://trac.sagemath.org/ticket/14711#comment:38>
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.