Cell memory not released

Jaroslav Hajek highegg at gmail.com
Thu Jul 30 07:09:35 CDT 2009


On Wed, Jul 29, 2009 at 10:09 AM, Rabeeh Abbasi<rabeeh36 at yahoo.com> wrote:
>> Apparently you are expecting it to shrink?
>
> Yes, I do expect it to shrink. As it always shrink when you "clear" a
> (large) matrix object.
>
> Regards,
> Rabeeh
>

Apparently this is a feature of the C++ or system memory management. Try:
n = 1e5; a = cell(1, 1e8/n); for i = 1:1e8/n, a{i} = zeros (1, n); end
clear a

the memory shrinks after clear.
however, when I change n to 1e4, it does not shrink. apparently
smaller fragments of memory are handled differently.

-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


More information about the Bug-octave mailing list