clean ram memory after deleting source filter

In the two cases, if I open the raw data using the GUI with the image reader or if i do it in python using the function mentionned here crashing when using clip over Image (Uniform Rectilinear Grid)

in the case of the GUI, i select the filter and simply delete it

in the case of python, i tested the two options, select the filter and simply delete it, and use Delete(filter)
in non of the cases the ram is being free, and therefore when I run the python function again OR import using the GUI on exactly same file (so memory should be enough, and when importing first time i had around 5 gb extra free) paraview simply crashes for lack of memory.