Re: Memory leak in BLAS/LINPACK - GNAT on OS X



Thought it i recognized this problem so i checked it out and found:
It is corrected in the Latest GNATPro version (the problem is in the compiler).

/Per

tkrauss wrote:
There have been a few messages on the GNAT-OSX mailing list about an
apparent memory leak in the Ada.Numerics.Long_Real_Arrays
implementation. The setup is an OS X box (10.4) with the GNAT 4.3
compiler from the macada.org site. The Ada.Numerics.Long_Real_Arrays
is using the Apple-supplied BLAS and LINPACK libraries under the
hood. The code snippet below (plagiarized from Jerry's post on the
mailing list) leaks memory (as reported by top). Note that the same
code but with Long_Complex types does not appear to have this problem.

Has anyone seen this problem on other platforms? Do other languages
on OS X behave this way? I'm not sure how to track down the guilty
party here. Is it Apple's BLAS or LINPACK libraries or something in
the GNAT Long_Real_Arrays multiply method?


with Ada.Numerics.Long_Real_Arrays;
use Ada.Numerics.Long_Real_Arrays;

procedure tst_simple is
v : Real_Vector(1 .. 100_000) := (others => 1.23);
res : Real_Vector(1 .. 100_000);
begin
for i in 1..1000 loop
res := 123.456 * v;
end loop;
end tst_simple;

.



Relevant Pages

  • Memory leak in BLAS/LINPACK - GNAT on OS X
    ... apparent memory leak in the Ada.Numerics.Long_Real_Arrays ... is using the Apple-supplied BLAS and LINPACK libraries under the ... The code snippet below (plagiarized from Jerry's post on the ... for i in 1..1000 loop ...
    (comp.lang.ada)
  • Re: Letter to US Sen. Byron Dorgan re unpaid overtime
    ... >> both less efficient and less safe than the Fortran and Basic standard. ... >> The C for loop is actually trying to do what a do loop does. ... sloppy thinking that results from confusing a programming language ... > I do not believe that you are capable of writing a conforming C compiler. ...
    (comp.programming)
  • Re: Letter to US Sen. Byron Dorgan re unpaid overtime
    ... it's a for loop in the C sense. ... > sloppy thinking that results from confusing a programming language ... >> I do not believe that you are capable of writing a conforming C compiler. ... Does Microsoft's C compiler perform this optimisation? ...
    (comp.programming)
  • Re: Histogram of character frequencies
    ... generated object code may simply be a loop in which elements are ... believe any C compiler anywhere would reject it. ... On the first iteration of the loop you test the end of file indicator ...
    (comp.lang.c)
  • Re: Fridays the thirteenth. (And a little puzzle.)
    ... -- compiler) is the usual method ... int febdays ... -- We're going to go round a loop dealing with each year in turn. ... -- other languages call) ...
    (uk.people.silversurfers)