You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@stephankramer@jwallwork23 could you please take a look at the simple example below? I tried to put it together to show the memory usage by the process before and after adapting the mesh. It really piles up when we have multiple meshes.
Edit: I cleaned up the example. Based on this I think there really is a memory leak. I am investigating but I've never used memory profilers before so it might take a bit. I will bring it up on the Friday meeting.
My workaround so far: use subprocess to adapt and checkpoint adapted_mesh. Then load it in the original script. This works well but it's a pain. But it might help the investigation of what we can get rid of and get this sorted properly.
Checkpointing the adapted_mesh above and then loading it in a separate script:
import os
import psutil
from firedrake import *
process = psutil.Process(os.getpid())
ram_usage = lambda: print("RAM usage", process.memory_info().rss / 1024**2)
ram_usage(). # 201 MB
with CheckpointFile(..., "r") as afile:
adapted_mesh = afile.load_mesh("adapted_mesh")
ram_usage(). # 227 MB
@stephankramer @jwallwork23 could you please take a look at the simple example below? I tried to put it together to show the memory usage by the process before and after adapting the mesh. It really piles up when we have multiple meshes.
Edit: I cleaned up the example. Based on this I think there really is a memory leak. I am investigating but I've never used memory profilers before so it might take a bit. I will bring it up on the Friday meeting.
This prints:
The text was updated successfully, but these errors were encountered: