#715: Parents probably not reclaimed due to too much caching
------------------------+---------------------------------------------------
Reporter: robertwb | Owner: somebody
Type: defect | Status: new
Priority: major | Milestone: sage-4.8
Component: coercion | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
------------------------+---------------------------------------------------
Comment(by SimonKing):
In my code for the computation Ext algebras of basic algebras, I use
letterplace algebras (see #7797), and they involve the creation of many
polynomial rings. Only one of them is used at a time, so, the others could
be garbage collected. But they aren't, and I suspect this is because of
using strong references in the coercion cache.
See the following example (using #7797)
{{{
sage: F.<a,b,c> = FreeAlgebra(GF(4,'z'), implementation='letterplace')
sage: import gc
sage: len(gc.get_objects())
170947
sage: a*b*c*b*c*a*b*c
a*b*c*b*c*a*b*c
sage: len(gc.get_objects())
171556
sage: del F,a,b,c
sage: gc.collect()
81
sage: len(gc.get_objects())
171448
sage: cm = sage.structure.element.get_coercion_model()
sage: cm.reset_cache()
sage: gc.collect()
273
sage: len(gc.get_objects())
171108
}}}
That is certainly not a proof of my claim, but it indicates that it might
be worth while to investigate.
In order to facilitate work, I am providing some other tickets that may be
related to this:
* #11521 (that might be solved, but needs review)
* #10262
* #8905
* #5970 (this might already be fixed)
I guess that one should use a similar cache model to what I did in #11521:
The key for the cache should not just be `(domain,codomain)`, because we
want that garbage collection of the cache item is already allowed if just
one of domain or codomain is collectable.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/715#comment:12>
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.