-
Notifications
You must be signed in to change notification settings - Fork 262
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 with opening/closing of files? #2626
Comments
Thanks; taking a look at this now. |
Similar to #2589 and Unidata/netcdf4-python#1021 |
Thanks; I'm able to recreate this, and have updated the code you provided to show this in real time via calls to |
Ok, so I while I try to formulate my thoughts around this (and the related issues), I believe that the problem might be out of our hands. The last step I need to take is to recreate this program using pure HDF5 calls, removing I'll post some graphs generated from various profilers I've used, but I'm not finding a memory "leak", per se; while the memory usage is growing, it doesn't appear to be a leak in the sense we think of memory leaks. This is supported by the failure of The alternative situation is if there is something more we should be doing when closing/free'ing an HDF5 file/object. I actually hope that this is the issue, because we can fix that. I would expect the tools I've been using to report these issues, however. Another thing that is dampening my optimism is that if I search for similar 'growing memory usage' issues in HDF5, ignoring netCDF, I find a lot of similar reports. A single process opening and closing HDF5 files thousands of time exhibit growing memory usage. But, we will do our due diligence and see what we can do. |
Further, if the issue is around the handling of the libhdf5 objects, it is non-obvious; the same tests using other storage formats (netCDF3, ncZarr) do not exhibit the same growing memory usage. |
Playing around with this some more, it feels like there might be a dangling open resources when an HDF5 is being closed. I should be able to follow up on this shortly. |
In julia (NCDatasets.jl) we are also observing this suspected memory leak with NetCDF version 4.9.2 and and HDF5 1.14.3. |
Software versions:
netcdf 4.9.0-3
hdf5 1.12.2-1
While debugging a memory leak which seems to be related to NetCDF, I was running the C code from this issue: Unidata/netcdf4-python#986, and still see memory usage growing linearly in time. According to that issue, this should have been fixed by: #1634 ? As with the previous issue, the problem disappears when using
NC_64BIT_OFFSET
, both with the example below, and the real-life issue with our LES model (which only opens/closes the NetCDF files once per experiment).Code to reproduce:
The text was updated successfully, but these errors were encountered: