<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_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>
---------------------------------------------
<p><span id="gmail-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>