Closed wmay closed 5 years ago
Those NCL changes haven't been integrated with PyNIO yet, mainly due to the large amount of changes to the HDF5 code, which likely requires a bit of work for the PyNIO wrappers. I suspect that is probably the cause as well. It will be updated eventually, but I don't have an ETA at this time. Thank you for the file!
If you feel like living dangerously, there's an 'ncl-update' branch that contains the new NCL updates, but it won't have the appropriate Python wrappers that support Python 3.x or the new HDF5 updates. You might be able to pull the GRIB stuff out of 'ncl-update' and put them in the 'develop' branch, rebuild, and it'll magically work. See build_py2.sh and build_py3.sh for some scripts to help with building (using a conda environment with the dependencies already installed). If you should venture down this dark and dangerous path and it fixes your problem, please let us know!
Well I can confirm that the issue is fixed in the ncl-update branch. It'll take me a little more time to try combining the branches.
Merging the code from the two branches works great and lets me use Python 3 and GRIB2 without memory blowing up.
There appears to be a memory leak when opening GRIB2 files.
Example
In this example the amount of memory used on my computer increases by about 9MB each iteration. (Download the example file here.)
I found a discussion on the NCL mailing list about a memory leak with GRIB2 files, and it was apparently fixed last year. If this is related to the PyNIO memory leak, maybe it can be fixed just by updating the NCL files?