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 leak in ideal arithmetic #15498
Comments
comment:1
Memory use is still increasing with 5.13.xx, but I don't see a particular object count go up in the way one would expect with a straight memory leak. This could just be fragmentation or some other difficult-to-control issue. The code I tried was:
Hopefully the memory use flattens out after a while. It may well be that there was a serious leak for this example before that is now fixed. It may also be that we really are leaking, but not in python memory. Perhaps libsingular? |
comment:2
Sadly, this is most definitely a memory leak and, as shown above, not one in python space. The most likely suspect is LibSingular, especially because we already know that we're not interfacing with LibSingular reference counting properly. This might be a particularly easy example to trace through, so it may be worth doing, because it might show the way to proper LibSingular memory management. Just to confirm:
i.e., each batch of 1000 iterations grows memory use very consistently. |
comment:3
Adding more expert as Cc. |
comment:4
I can confirm that this time it is not a problem with cyclic garbage collection, as the number of objects tracked by the gc module does not increase:
So, it could actually be that the Sage code triggers a memory leak in Singular. |
comment:5
Note the following variation:
So, we need to compare ideals to see the leak. It is not enough to just create the ideals and then just test if they are nonzero. Edit: By the way, I just noticed:
|
comment:6
PS: |
comment:7
|
comment:8
Replying to @simon-king-jena:
More circumstantial evidence. I left it running and found:
(I was also intending to do the checks you've already done) |
comment:9
grml, trac ate my comment. I checked and it boils down to (at least also) computation Gröbner bases:
and
|
comment:13
ping |
comment:14
The leak is still there:
and even
Hard to believe that this should be a leak in Singular. But apparently it is even in our more basic libsingular wrapper:
Later today I'll try pure singular. |
comment:15
I tried this in Singular:
The memory consumption is constant, but I suppose that's because Singular knows that if an ideal is generated by a single element then this element is a standard basis:
So, let's try with a different case:
So, it seems that the leak is in Sage and not in Singular, which I think is not a surprise. |
From google spreadsheet which no one reads X-(
CC: @simon-king-jena @sagetrac-PolyBoRi @malb
Component: algebra
Issue created by migration from https://trac.sagemath.org/ticket/15498
The text was updated successfully, but these errors were encountered: