This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Huaiyu, > My code compiled with netcdf 4.0.1 keeps growing in size while > running. There is no explicit memory allocation in the code except in > the initialization part. While it runs the code periodically stores > some data to a netcdf4 file. Does netcdf reuses its buffers or do I > need to explicitly call some some function to release some of the > buffers? Thanks. Memory leaks in both HDF5 and netCDF-4 have been fixed since netCDF 4.0.1 was released. I suggest you get HDF 1.8.4 and use it with either the current netCDF snapshot release ftp://ftp.unidata.ucar.edu/pub/netcdf/snapshot/netcdf-4-daily.tar.gz or with the 4.1 release, which will be made available soon. You should not have to release memory while running, except that if you are accessing netCDF-4 data of a user-defined type that makes use of netCDF-4 strings or netCDF-4 variable-length objects (vlens), you need to call the appropriate "free" function when you are done with the data values. The functions involved are nc_free_string and nc_free_vlens (or the analogous Fortran-90 functions). --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: RPP-420427 Department: Support netCDF Priority: Normal Status: Closed