<div dir="ltr"><div><div><div><div><div><div><div><div>Hi Andy,<br><br></div>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:<br><br></div> a = x(0,:)<br></div> b = y(0,:)<br></div> c = z(0,:)<br></div> list1 = [/a,b,c/]<br> ...<br></div> delete(list1)<br><br></div>Hope the helps...and thanks for calling out the problem.<br></div>Rick<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 30, 2017 at 8:16 AM, Andy Penny <span dir="ltr"><<a href="mailto:andybpenny@gmail.com" target="_blank">andybpenny@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p>Hi there,</p>
<p>I encountered a memory leak when using list variables in NCL (v6.4 from <span>ncl_ncarg-6.4.0-RHEL6.4_<wbr>64bit_nodap_gnu447.tar.gz</span>).
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? <br>
</p>
<p>Thanks,</p>
<p>Andy</p>
------------------------------<wbr>---------------
<p><span id="m_3046410140599827331gmail-x_ms-rterangepaste-start"></span></p>
x = new((/2,20000/),float)<br>
y = new((/2,20000/),float)<br>
z = new((/2,20000/),float)<br>
<br>
x(0,:) = fspan(0,20000,20000)<br>
y(0,:) = fspan(0,20000,20000)<br>
z(0,:) = fspan(0,20000,20000)<br>
<br>
x(1,:) = fspan(0,20000,20000)<br>
y(1,:) = fspan(0,20000,20000)<br>
z(1,:) = fspan(0,20000,20000)<br>
<br>
do i = 0, 100000<br>
print("i= "+i)<br>
<br>
; list1 = [/x,y,z/] ; works properly<br>
list1 = [/x(0,:),y(0,:),z(0,:)/] ; causes memory leak<br>
<br>
delete(list1)<br>
end do</div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>