Hi!
On 3 Mai, 08:48, [email protected] wrote:
,,,
> I think in this way one would have unique parents *and* would fix the
> memory leak, but I am afraid I don't know enough about weak references
> to implement it.
Thanks to google, I found how it works:
Replace the line
_cache = {}
in sage.rings.polynomial.polynomial_ring_constructor by
from weakref import WeakValueDictionary
_cache = WeakValueDictionary({})
One can then do
sage: for p in primes(2,1000000):
....: R.<x,y,z> = GF(p)[]
sage: get_memory_usage()
778.35546875
Hmm. Are these the 800 MB of RAM that Alex was talking about?
Anyway. There is a patch awaiting review at # 5970
Cheers,
Simon
--~--~---------~--~----~------------~-------~--~----~
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-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---