| 1 | initial version |
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.
| 2 | No.2 Revision |
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
| 3 | No.3 Revision |
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.
| 4 | No.4 Revision |
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.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.