Question: How to save plots and use garbage collector?

Hi everyone

I've come across a RAM-issue.

My program creates a lot of plots using millions of variables-values and it eats up my computers memory since I use the plots to make an animation.

The plots are simple 3d plots created using the surfdata function.

How do I save plots into a single file as the program creates them concurrently such that after the program has terminated I can use the plots to create an animation?

and how do I efficiently delete variables I dont not need anymore?

Please Wait...