Ask Your Question
2

`solve_right` causes increasing memory usage of python.exe

asked 2022-10-25 19:16:59 +0100

azerbajdzan gravatar image

updated 2022-10-25 20:33:48 +0100

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 flag offensive close merge delete

Comments

What version of Sage?

Max Alekseyev gravatar imageMax Alekseyev ( 2022-10-25 22:18:50 +0100 )edit

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

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

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-10-26 15:00:33 +0100

Max Alekseyev gravatar image

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

edit flag offensive delete link more

Comments

Is it the same with newest version?

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

Yes, the memory use grows with time.

Max Alekseyev gravatar imageMax Alekseyev ( 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.

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

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

Max Alekseyev gravatar imageMax Alekseyev ( 2022-10-26 17:11:51 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2022-10-25 19:16:59 +0100

Seen: 152 times

Last updated: Oct 25 '22