# solve_right causes increasing memory usage of python.exe

Why the following code keeps increasing memory usage of python.exe? After first run the memory usage is about 1GB and do not drop even after code execution is finished. After second run about 2GB and so on... Notice that the for loop is doing the same in every step regardless of poz value.

R = IntegerModRing(26)
b=Matrix(R,[[19, 7, 4, 5, 20, 11, 19, 14],
[13, 2, 14, 20, 13, 19, 24, 6],
[17, 0, 13, 3, 9, 20, 17, 24],
[18, 0, 8, 3, 5, 17, 8, 3],
[0, 24, 0, 13, 8, 13, 21, 4],
[18, 19, 8, 6, 0, 19, 8, 14],
[13, 14, 5, 0, 19, 11, 0, 13],
[19, 0, 18, 17, 4, 2, 4, 13],
[19, 15, 17, 8, 12, 0, 17, 24]])
c=Matrix(R,[[5, 16, 12, 25, 23, 12, 20, 16],
[8, 22, 14, 13, 18, 17, 7, 9],
[18, 0, 13, 14, 11, 1, 18, 23],
[8, 17, 8, 1, 9, 24, 19, 19],
[19, 2, 15, 2, 14, 24, 15, 18],
[4, 0, 14, 16, 6, 20, 23, 18],
[11, 8, 20, 25, 15, 5, 5, 4],
[11, 12, 11, 18, 4, 5, 1, 18],
[8, 17, 22, 11, 4, 12, 8, 7]])

for poz in range(0,100000):
try:
b.solve_right(c)
print(poz)
except: False

edit retag close merge delete

What version of Sage?

( 2022-10-25 22:18:50 +0100 )edit

'SageMath version 8.9, Release Date: 2019-09-29'

( 2022-10-25 22:21:28 +0100 )edit

Sort by ยป oldest newest most voted

Apparently it's a memory leak, which needs to be reported at https://trac.sagemath.org

more

Is it the same with newest version?

( 2022-10-26 15:19:23 +0100 )edit

Yes, the memory use grows with time.

( 2022-10-26 15:44:29 +0100 )edit

How is it possible that such a function can be published without even checking how it works. And how is it possible that since 2019 nobody noticed it.

( 2022-10-26 16:33:37 +0100 )edit

That is a rhetorical question. Just submit a bug report.

( 2022-10-26 17:11:51 +0100 )edit

## Stats

Seen: 152 times

Last updated: Oct 25 '22