Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overturn limitation when releasing deep datastructures involving TripleDicts and other weakrefs #15070

Closed
nthiery opened this issue Aug 20, 2013 · 3 comments

Comments

@nthiery
Copy link
Contributor

nthiery commented Aug 20, 2013

Deleting TripleDicts and other weakref friends is currently recursive which limits
the depth of datastructures involving them that can be safely deleted. E.g:

from sage.structure.coerce_dict import MonoDict
M = MonoDict(11)

class A: pass
a = A()
prev = a

for i in range(1000):
    newA = A()
    M[prev] = newA
    prev = newA

len(M)
del a
Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in <sage.structure.coerce_dict.MonoDictEraser object at 0x5a13788> ignored

#10963 is apparently putting more stress on our weakref data structure
and triggers such recursion errors. See
#10963 comment:90 and followups for a
discussion.

CC: @vbraun @nbruin @simon-king-jena

Component: memleak

Reviewer: Simon King

Issue created by migration from https://trac.sagemath.org/ticket/15070

@nthiery nthiery added this to the sage-5.12 milestone Aug 20, 2013
@simon-king-jena
Copy link
Member

Changed author from Simon King to none

@simon-king-jena
Copy link
Member

Reviewer: Simon King

@simon-king-jena
Copy link
Member

comment:1

I was faster ;)

This ticket is a duplicate of #15069.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants