Reset Session programatically in python macro

Hello,

I’m running a macro with loops that use a lot of memory. What I’d like to do is to clean the memory between loops. However if I add a

ResetSession()

in the macro, Paraview crashes.
I tried something like

for x in GetSources().values():
Delete(x[0])

but it doesn’t seem to clean the memory.

Is there a solution to this problem?

Thanks,
Gianmarco

This is a known issue, unfortunately.

https://gitlab.kitware.com/paraview/paraview/-/issues/18261

A work around is to use

Disconnect()
Connect()

Thank you for your reply Cory.
It seems, however, that also the Disconnect() / Connect() method crashes if used in a macro.
Isn’t there any other way to free memory while in use? I could also accept to close and reopen Paraview, as long as it is automated.

Thanks

I just marked this as a showstopper for the 5.11 release. (Reference the bug Cory pointed at.) I hate crashes, and it looks like there isn’t a workaround. Thanks Gianmarco for reporting.