-
-
Notifications
You must be signed in to change notification settings - Fork 509
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
Memory leaks in libsingular polynomial evaluation and substitution #27261
Comments
comment:1
For testing, I changed the code so that the Result: In the above examples, the Conclusion: The memleak occurs in Sage's usage of libsingular. Apparently the underlying data of a polynomial are not correctly freed when it is deallocated. |
comment:2
Or, another possibility: Some temporary libsingular data created during the computation of Q is not freed. To detect this, I will try to make the example more fine-grained: Test if the leak occurs if the only arithmetic operation involved is |
comment:3
Interestingly, creating a copy of P from scratch does not leak:
So, it seems that calling the polynomial (i.e., |
comment:4
Note that there previously was a leak in polynomial evaluation, as by comment in |
comment:5
|
comment:6
Also, So, basically the |
comment:8
Ticket retargeted after milestone closed (if you don't believe this ticket is appropriate for the Sage 8.8 release please retarget manually) |
comment:9
As the Sage-8.8 release milestone is pending, we should delete the sage-8.8 milestone for tickets that are not actively being worked on or that still require significant work to move forward. If you feel that this ticket should be included in the next Sage release at the soonest please set its milestone to the next release milestone (sage-8.9). |
comment:10
Stumble upon a similar problem using
See also https://ask.sagemath.org/question/29444/high-memory-usage-when-substituting-variables/ |
comment:11
Since |
Commit: |
New commits:
|
Changed dependencies from #13447 to none |
Branch: u/vdelecroix/27261 |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:58
Replying to @dimpase:
Apparently, partially fixed in b983a8a. |
comment:59
This ask-sage question reports that there is also a performance problem with polynomial evaluation. Could this be related to the issue of this ticket? The example from the linked question is about 10 times slower than the naive Python substitution. |
comment:60
Replying to @mwageringel:
This ticket is not about performance issue. But as I mentioned in the ask question switching to naive Python evaluation as done in my branch actually speeds up the evaluation. |
comment:61
ping? |
comment:62
testing... |
comment:63
lgtm |
Reviewer: Dima Pasechnik |
comment:64
thx |
comment:65
one test broken on macOS:
(tested together with #30801, but I guess it doesn't matter. |
comment:66
The sagemath-singular interface is worse than what I thought. Switching to a generic |
comment:68
how about adding latest upstream fixes as patches? |
still leaks with Sage 10.1.beta6 (Singular 4.3.2) sage: R = PolynomialRing(ZZ, 'x', 50)
sage: d = {str(g): g for g in R.gens()}
sage: p = sum(d.values())
sage: import gcsage: while (1):
....: for _ in range(50):
....: _ = p.subs(**d)
....: _ = gc.collect() and observing memory consumption growing in another ternimal running |
If someone wants to monitor memory leak directly in Sage, it can be done via psutil module. Here is a modified example:
Here
|
The following two examples leak memory (in sagemath from 8.9 to 9.3.rc5)
and
This was reported on sage-devel and ask.sagemath.org.
We fix
.subs
(the first example above) by modifying the appropriate singular call. We identified two possibly related memory leaks in singularIn the mean time, we use the non-satisfactory solution of going via naive substitution in Python. To do so, we moved the generic implementation on the base class
MPolynomial
.See also #13447 also related to memory handling in singular.
Upstream: Reported upstream. No feedback yet.
CC: @nbruin @malb
Component: memleak
Keywords: libsingular polynomial memleak
Author: Vincent Delecroix, Dima Pasechnik
Branch/Commit: u/vdelecroix/27261 @
edf8847
Reviewer: Dima Pasechnik
Issue created by migration from https://trac.sagemath.org/ticket/27261
The text was updated successfully, but these errors were encountered: