[ncl-talk] memory leak when using list variables

Andy Penny andybpenny at gmail.com
Fri Jun 30 08:16:45 MDT 2017


Hi there,

I encountered a memory leak when using list variables in NCL (v6.4 from
ncl_ncarg-6.4.0-RHEL6.4_64bit_nodap_gnu447.tar.gz). If subsections of
variables (e.g., var(0,:)) are included in the list instead of the entire
variable, memory is not freed up when the list is later deleted. Below is a
simple script that demonstrates the issue. Is this normal behavior?

Thanks,

Andy
---------------------------------------------

x = new((/2,20000/),float)
y = new((/2,20000/),float)
z = new((/2,20000/),float)

x(0,:) = fspan(0,20000,20000)
y(0,:) = fspan(0,20000,20000)
z(0,:) = fspan(0,20000,20000)

x(1,:) = fspan(0,20000,20000)
y(1,:) = fspan(0,20000,20000)
z(1,:) = fspan(0,20000,20000)

do i = 0, 100000
  print("i= "+i)

;  list1 = [/x,y,z/]                ; works properly
  list1 = [/x(0,:),y(0,:),z(0,:)/]  ; causes memory leak

  delete(list1)
end do
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170630/c14b1f4e/attachment.html 


More information about the ncl-talk mailing list