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

Destructors for all classes #874

Closed
erikvansebille opened this issue Jun 24, 2020 · 0 comments
Closed

Destructors for all classes #874

erikvansebille opened this issue Jun 24, 2020 · 0 comments
Assignees

Comments

@erikvansebille
Copy link
Member

One of the major sources for memory leaks in Parcels is the lack of destructors (__del__(self)) functions, which are called when an object is deleted. This accounts mostly for dynamic member variable data (e.g. Numpy/xarray/dask matrices) that are initialised in the constructor, expanded during execution and so on. But, for the removal, Parcels currently relies on the interpreter finding all the references. That is prone to error, and a class that does not use its member array data should release them.

Thanks to @CKehl for bringing this up

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

No branches or pull requests

1 participant