#12616: The LP are not deallocated because of cyclic references !
----------------------------------+-----------------------------------------
Reporter: ncohen | Owner: ncohen
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.0
Component: linear programming | Keywords:
Work_issues: Add doctest | Upstream: N/A
Reviewer: | Author: Nathann Cohen
Merged: | Dependencies:
----------------------------------+-----------------------------------------
Comment(by SimonKing):
Hi Nathann,
is it really safe to do
{{{
sage: just_create_variables()
sage: len([x for x in gc.get_objects() if isinstance(x,C)])
}}}
without a garbage collection between the two lines?
Of course, the variables created inside `just_create_variables` are
deleted when it is done. However, there is no guarantee that a deleted
object is immediately garbage collected. In general, garbage collection
can happen between any two Python calls -- sooner or later.
Hence, it could be that the doc test example runs into a racing condition,
and it could happen that the test randomly fails when Python decides that
it is not in the mood for an immediate garbage collection. I suggest to
insert
{{{
sage: _ = gc.collect()
}}}
between the two lines, just to be on the safe side.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12616#comment:6>
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.