[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #RPP-420427]: memory leak



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