-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
The coercion model is keeping references to tracebacks which causes memory leaks. #10548
Comments
comment:1
Ps. you might want to use smaller numbers then 97 to test because ModularSymbols(Gamma1(97),sign=1) takes a while. It behaves the same, but with smaller memory usage for smaller numbers. |
comment:2
According to heapy the aditional memory comes from; dict of sage.modular.modsym.manin_symbols.ManinSymbol
|
This comment has been minimized.
This comment has been minimized.
comment:4
It's not an error of the ModularSymbols_clear_cache() function
|
comment:5
See the attached chain.png picture created with objgraph. There is a reference chain to the homset module. And the homeset module will not get destroyed so we have to find out where this chain comes from. |
comment:6
Might this be an instance of #715? Modular symbols spaces are Parents, so various maps in and out of them are probably getting cached by the coercion model machinery. |
Attachment: chain.png |
comment:7
Sorry I failed in adding the mentioned chain.png before. It shows a reference chain explaining why ManinSymbol(37,35) is still in the memory. It seems that it has at least to do something with code in the homset module. I don't know enough details about the coercion and category framework and their interaction to say that it has something to do with 715. But the description of 715 really looks like it could be the cause. If it is coercion, it might also be related to: #10570 |
This comment has been minimized.
This comment has been minimized.
comment:10
Here is some code run on sage 4.6.1 showing that it is really the coercion framework.
|
comment:11
btw it goes wrong in the same way on 4.7.alpha1 |
This comment has been minimized.
This comment has been minimized.
Attachment: 10548-coerce-traceback.patch.gz |
comment:14
The attached patch fixes the issue described in the title, but does not fix #715. |
Attachment: 10548-coerce-traceback.2.patch.gz rebased against 4.7.alpha1 |
comment:15
Looks good to me. |
comment:16
Attachment: 10548-coerce-traceback-doctest.patch.gz |
comment:17
Robert, (or someone else), can you review the doctest I added? |
Reviewer: Maarten Derickx |
Author: Robert Bradshaw |
This comment has been minimized.
This comment has been minimized.
comment:19
The doctest looks good to me. |
Attachment: trac_10548-coerce-traceback-doctest.v2.patch.gz new doctest |
This comment has been minimized.
This comment has been minimized.
comment:20
I folded in the doctest from the current patch at #10570, also by Maarten. |
This comment has been minimized.
This comment has been minimized.
Merged: sage-4.7.alpha4 |
When I was doing some computations on modular forms, I noticed that the ModularSymbols_clear_cache() was not doing what it claims to do.
So even after garbage collection the modular symbols element is still in memory.
When testing please also make sure that the last stackframe from #10570 is also gone.
Apply attachment: 10548-coerce-traceback.2.patch and attachment: trac_10548-coerce-traceback-doctest.v2.patch
CC: @loefflerd
Component: coercion
Author: Robert Bradshaw
Reviewer: Maarten Derickx
Merged: sage-4.7.alpha4
Issue created by migration from https://trac.sagemath.org/ticket/10548
The text was updated successfully, but these errors were encountered: