mtrace for a fortran program
Davide Del Vento
ddvento@ucar.edu
Thu Dec 11 19:10:00 GMT 2008
> The code you posted in
>
> http://stackoverflow.com/questions/260192/mtrace-for-a-fortran-program
>
> does not leak memory. If the compiler, in our case gfortran, conforms
> to the Fortran 95 standard, it will not leak memory.
Steve,
thank you very much for your note. It has been incredible useful!
Actually I am mostly I C/C++ guy, thus I didn't realize the issue.
In fact the IBM compiler I tested before gfortran was leaking memory,
thus I thought that was the expected behavior (probably I will fill a
bug report with them).
I tried the same source code with both compilers and the
gfortran-produced executable is not leaking (I made a long lived test
program and checked with top).
Of course, changing "allocatable" with "pointer" does leak with gfortran
too. And the good news is that mtrace is able to detect it! The bad news
is that it doesn't track the source code line (yes, I compiled with -g)
but I'll work on that and report onlist if I will find something
not-obvious.
Thanks again.
Davide Del Vento, Consulting Services Software Engineer
NCAR Computational & Information Services Laboratory
http://www.cisl.ucar.edu/hss/csg/
office: Mesa Lab, Room 42B
More information about the Fortran
mailing list