Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leak in netgen.csg Module #161

Open
TBeKL opened this issue Aug 8, 2023 · 0 comments
Open

Memory Leak in netgen.csg Module #161

TBeKL opened this issue Aug 8, 2023 · 0 comments

Comments

@TBeKL
Copy link

TBeKL commented Aug 8, 2023

When working with objects of the netgen.csg module, the memory reserved for the Python process increases continuously. It is possible that the reserved memory is not released or only partially released when objects are destroyed. The following minimal example illustrates the problem.

from netgen.csg import Pnt, Plane, Vec

args = (Pnt(0, 0, 0), Vec(1, 0, 0))

for i in range(1000000):
    Plane(*args)

The figure in the appendix shows the reserved memory over runtime captured by memory profiler 0.61.0. The memory increases continuously and is only released when the process ends.
As I use NGSolve to compute time-dynamic systems with complex geometries and create many of these objects repeatedly, this is a very severe limitation.
I’m using Python 3.7.9 with NGSolve 6.2.2102.
Figure_1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant