NREL / gdx-pandas

Python interface to read and write GAMS GDX files using pandas.DataFrames as the intermediate data format.
BSD 3-Clause "New" or "Revised" License
43 stars 15 forks source link

Prevent memory leak #79

Closed jebob closed 4 years ago

jebob commented 4 years ago

If atexit knows what "self" is here, it stores the entire GDX object until the python instance ends.

This works as long as _H doesn't change during execution (this is currently guaranteed due to the lack of a setter for H).

Running the first snippet on 78 doesn't have a RAM usage increasing over time if this change is applied.

Closes #78

elainethale commented 4 years ago

Thanks, @jebob -- nice catch!