@@ -1,5 +1,6 @@
#!/usr/bin/env python3
import os
+import gc
import subprocess
import csv
import sys
@@ -42,6 +43,8 @@ def create_graph(file, title=None):
def run_devstone(run_simulation_func, model_type, depth, width, mode, out, mem_cmd, stats, DCP, *, classic=False, number=1, gen_mode="uniform"):
"""Runs the simulation function in-process and handles memory profiling asynchronously if needed."""
+ gc.collect()
+
pp_proc = None
if mem_cmd:
my_pid = os.getpid()