adtzlr / felupe

:mag: finite element analysis for continuum mechanics of solid bodies
https://felupe.readthedocs.io/
GNU General Public License v3.0
81 stars 11 forks source link

Memory Leak: Massive RAM increase due to repeated `FieldContainer.imshow()` #833

Open adtzlr opened 3 months ago

adtzlr commented 3 months ago

In an interactive session. It seems that the screenshot method, especially with nonlinear_subdivision > 1, eats the RAM. Unfortunately, we can't do much about it.

import felupe as fem

mesh = fem.Circle(n=12).add_midpoints_edges()
plotter = mesh.plot(off_screen=True)
img = plotter.screenshot()

import matplotlib.pyplot as plt

plt.imshow(img)

grafik

Even for such simple meshes and without nonlinear_subdivision > 1, only Restart Kernel helps to free the memory in an interactive Python session after multiple screenshot calls.

adtzlr commented 2 months ago

this could be related to https://github.com/pyvista/pyvista/issues/2252

adtzlr commented 1 month ago

Hmm. This seems to be platform dependent. On Windows, the increase of RAM usage is notable but not that massive as on Linux.