# Revision history [back]

You can use the garbage collector:

import gc
gc.enable()
mat = random_matrix(SR,69,70)
for i in range(100):
Inter_mat=mat.transpose()
Solution=Inter_mat.left_kernel()
print get_memory_usage()
gc.collect()

1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
....


You can also collect less often.

You can use the garbage collector:

import gc
gc.enable()
mat = random_matrix(SR,69,70)
for i in range(100):
Inter_mat=mat.transpose()
Solution=Inter_mat.left_kernel()
print get_memory_usage()
gc.collect()

1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
....


You can also collect less often.often, or set a frequency, etc. See this page

You can use the garbage collector:

import gc
gc.enable()
mat = random_matrix(SR,69,70)
for i in range(100):
Inter_mat=mat.transpose()
Solution=Inter_mat.left_kernel()
print get_memory_usage()
gc.collect()

1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
....


You can also collect less often, or set a frequency, etc. and so on. See this page.

You can use force the garbage collector:collection as follows:

import gc
gc.enable()
mat = random_matrix(SR,69,70)
for i in range(100):
Inter_mat=mat.transpose()
Solution=Inter_mat.left_kernel()
print get_memory_usage()
gc.collect()

1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
1109.7109375
....


You can also collect less often, set a frequency, and so on. See this page.