CADLabs / radCAD

A Python framework for designing, testing, and validating complex systems through modelling and simulation.
GNU General Public License v3.0
99 stars 25 forks source link

PyO3 memory leak #2

Closed BenSchZA closed 3 years ago

BenSchZA commented 4 years ago

See comment on Gitter:

Hi everyone! I found a few threads re. PyO3 memory use, the GIL, releasing the GIL to free memory, etc. (PyO3/pyo3#311, https://github.com/Renmusxd/pyo3_memory, https://github.com/PyO3/pyo3/issues/319). In my package https://github.com/BenSchZA/radCAD I'm creating large lists of dictionaries, calling Python functions, and passing the list to those functions. In Python, that process uses maybe 500mb of memory, in PyO3, it quickly ramps up to 5GB+. The library is less than 300 loc, so maybe someone would be able to suggest a solution - because I'm relying on creating and using large PyLists maybe there isn't a way to free the memory easily?

image

BenSchZA commented 3 years ago

Resolved as of v0.1.8