Garbage collection
import sys
from mymem import alloc
import gc
if len(sys.argv) < 2:
exit(f"Usage: {sys.argv[0]} N")
count = int(sys.argv[1])
for _ in range(count):
alloc()
input("Run gc")
gc.collect()
input("End the script")
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
import sys
from mymem import alloc
import gc
if len(sys.argv) < 2:
exit(f"Usage: {sys.argv[0]} N")
count = int(sys.argv[1])
for _ in range(count):
alloc()
input("Run gc")
gc.collect()
input("End the script")