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.
>To: address@hidden >cc: address@hidden >From: V Lakshmanan <address@hidden> >Subject: memory leak in the netcdf C++ interface? >Organization: OU >Keywords: 200308291434.h7TEYmLd014599 netCDF C++ Hi Lak, > In the netcdf-c++ interface (I'm using version > 3.5.1-beta12), is there a memory leak in that > this variable (line 1081) > cur_rec = new long[MAX_NC_DIMS]; > is not deleted in the destructor? Variable > "the_cur" is deleted okay. > > We are seeing programs grow slowly, and after > checking memory usage, found that some memory allocated > in init_cur() was not released. I have a > feeling it is due to the NcVar's created whenever > I open new files. Yes, you're right, this is fixed in netCDF version 3.5.1-beta13, available from: ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-3.5.1-beta13.tar.Z Please let us know if this doesn't fix the problem. --Russ