Ask Your Question
2

`solve_right` causes increasing memory usage of python.exe

asked 2 years ago

azerbajdzan gravatar image

updated 2 years ago

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
Preview: (hide)

Comments

What version of Sage?

Max Alekseyev gravatar imageMax Alekseyev ( 2 years ago )

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

azerbajdzan gravatar imageazerbajdzan ( 2 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 2 years ago

Max Alekseyev gravatar image

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

Preview: (hide)
link

Comments

Is it the same with newest version?

azerbajdzan gravatar imageazerbajdzan ( 2 years ago )

Yes, the memory use grows with time.

Max Alekseyev gravatar imageMax Alekseyev ( 2 years ago )

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 ( 2 years ago )

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

Max Alekseyev gravatar imageMax Alekseyev ( 2 years ago )

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: 2 years ago

Seen: 310 times

Last updated: Oct 25 '22