Here are the examples of the python api System.GC.Collect taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
3
Example 1
def GetTotalMemory():
import System
# 3 collect calls to ensure collection
for x in range(3):
System.GC.Collect()
System.GC.WaitForPendingFinalizers()
return System.GC.GetTotalMemory(True)
3
Example 2
def force_gc():
if is_silverlight:
return
elif is_cpython:
import gc
gc.collect()
else:
import System
for i in range(100):
System.GC.Collect()
System.GC.WaitForPendingFinalizers()