[ncl-talk] memory leak when using list variables
Rick Brownrigg
brownrig at ucar.edu
Fri Jun 30 09:37:21 MDT 2017
Hi Andy,
I would say that's not normal behavior. Thanks for the script that so
clearly demonstrates the behavior. I will file a bug report and let you
know the tracking number. It does seem related to specifying the slices
directly in the list creation; as a work-around, the following works OK:
a = x(0,:)
b = y(0,:)
c = z(0,:)
list1 = [/a,b,c/]
...
delete(list1)
Hope the helps...and thanks for calling out the problem.
Rick
On Fri, Jun 30, 2017 at 8:16 AM, Andy Penny <andybpenny at gmail.com> wrote:
> 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
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170630/0f801f69/attachment.html
More information about the ncl-talk
mailing list