[ncl-talk] Memory leak with grib2 files

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Thu Jun 29 10:09:53 MDT 2017


NCL team,

When reading a series of grib2 files, I get a serious memory leak.  For
each grib2 file of about 60 Mb size, it seems that about 15 Mb of user
memory is consumed by addfile, and never released.

Is this an NCL bug?  Is there a quick fix or a patch available?

We tested similar scenarios with Netcdf file sets, and never saw a memory
accumulation like this.

I tested this with NCL 6.4.0 on two systems, and got identical behavior:

* Mac OS El Capitan (10.11.6)
* Linux, Centos 6.9.

Following is a simple test case.  I suggest using any available grib2 data
set for your own testing.  I can upload some of these grib2 files if you
can't duplicate the behavior with your own files.

begin
  base = "/Projects/Reforecast2/1985/198501/"
  wildcard = "198501??00/[cp]??/latlon/hgt_pres_198501??00_???.grib2"

  files  = systemfunc ("ls -1 " + base + wildcard)
  nfiles = dimsizes (files)
  print ("Number of files = " + nfiles)

  do i = 0, nfiles-1
    f = addfile (files(i), "r")
    print (i + "  " + files(i))
    delete (f)
  end do
end

Thanks for looking into this.

--Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170629/a87743a8/attachment.html 


More information about the ncl-talk mailing list