You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[18:35] <william> indeed!
[18:35] <william> david harvey is totally right about that memory leak!
[18:35] <william> Try the following two distinct blocks of code, where m = get_memory_usage
[18:35] <william> print m()
[18:35] <william> n = random_matrix(RR, 200)
[18:35] <william> n.set_immutable()
[18:35] <william> hash(n)
[18:35] <william> del n
[18:35] <william> m()
[18:35] <william> -- and --
[18:35] <william> print m()
[18:35] <william> n = random_matrix(RR, 200)
[18:35] <william> n.set_immutable()
[18:35] <william> del n
[18:35] <william> m()
[18:36] <william> The first leaks about 3MB every time. The second doesn't leak at all.
[18:36] <robertwb> ouch
[18:36] <robertwb> yes, it's a new reference (though it may or may not be a new object)
print m()
n = random_matrix(RR, 200)
n.set_immutable()
hash(n)
del n
m()
It appears that
FAST_SEQ_UNSAFE
creates a new reference to the list but never releases it.It might be because
PySequence_Fast
returns a new reference, butPySequence_Fast_ITEMS
doesn't release it.See also
http://docs.python.org/api/sequence.html
CC: @sagetrac-dmharvey
Component: basic arithmetic
Issue created by migration from https://trac.sagemath.org/ticket/293
The text was updated successfully, but these errors were encountered: