I am having a problem when running the left_kernel function multiple times. Every time I call the function It takes a new part of the memory although I do not create new variables. I tried finding out where does the memory disappear, but without any luck. here is an example code:
sage: mat
69 x 70 dense matrix over Symbolic Ring (type 'print mat.str()' to see all of the entries)
sage: get_memory_usage() #memory check before call
1170.34765625
sage: Inter_mat=mat.transpose()
sage: Solution=Inter_mat.left_kernel()
sage: get_memory_usage() #memory check after 1st call
1190.5390625
sage: Inter_mat=mat.transpose()
sage: Solution=Inter_mat.left_kernel()
sage: get_memory_usage() #memory check after 2nd call
1194.73828125
sage: Inter_mat=mat.transpose()
sage: Solution=Inter_mat.left_kernel()
sage: get_memory_usage() #memory check after 3rd call
1217.76953125
As you can see every time I call the function, the memory usage increases. Is there a way to release the memory that was used in a previous call ? My program stops after a few iterations because of lack of memory.