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