From: vittorio.casella on
I suspect that the DelaunayTri function wastes memory. I prepared a
script containing the code fragment

load data_error_delaunay
for i=1:1000
i
dt=DelaunayTri(x,y);
save results dt
end

The code loads two vectors x and y from a MAT file. Then it repeats
the same tasks for many times. If the above-listed code is execute
immediately after the launch of Matlab, the code is perfectly executed
for the first 10 iterations, while during the 11th the following error
message is shown

??? Error using ==> save
Error closing file results.mat.

I studied the issue and noticed that, at each iteration, the amount of
free memory, shown by the MEMORY command, greatly decreases, until it
almost vanishes.

After the first execution of the script, ended with the above-shown
error, if the script is launched again, it crashes at the first
iteration.
If a perform the clear all – pack commands, then the script stops at
the 7th iteration. Further attempts stop at the first iteration.

If I switch Matlab off and on, then the script stops again at the 11th
iteration.

During my repeated tests, the following error message was issued
??? Error using ==> DelaunayTri
Insufficient memory available to perform DelaunayTri operation.

But the WHOS command shows
whos
Name Size Bytes Class Attributes
ans 1x1 8 double
i 1x1 8 double
x 280120x1 2240960 double
y 280120x1 2240960 double

while the MEMORY command shows
memory
Maximum possible array: 1 MB (1.331e+006 bytes) *
Memory available for all arrays: 47 MB (4.978e+007 bytes) **
Memory used by MATLAB: 1783 MB (1.870e+009 bytes)
Physical Memory (RAM): 3582 MB (3.756e+009 bytes)

* Limited by contiguous virtual address space available.
** Limited by virtual address space available.


My conclusion: the DelaunayTri function wastes memory. To recover it,
it is necessary to restart Matlab.

Waiting for suggestions or explanations. Regards

Vittorio Casella
From: Rune Allnor on
On 4 Jul, 14:52, "vittorio.case...(a)gmail.com"
<vittorio.case...(a)gmail.com> wrote:

> Waiting for suggestions or explanations. Regards

Post this to matlab technical support.

Rune
From: Vittorio Casella on
Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <a4249ed0-04bb-47e9-bef6-df46190cb619(a)g19g2000yqc.googlegroups.com>...
> On 4 Jul, 14:52, "vittorio.case...(a)gmail.com"
> <vittorio.case...(a)gmail.com> wrote:
>
> > Waiting for suggestions or explanations. Regards
>
> Post this to matlab technical support.
>
> Rune

Hi Rune, I'll post the message to the technical support, of course. I was curious to hear from other people if they had similar experiences. Greetings
Vittorio