Sebastien Bardeau writes:
> Le 02/07/2012 02:01 PM, Tobias Burnus a écrit :
>> On 02/07/2012 01:34 PM, Sebastien Bardeau wrote:
>>> I am wondering if gfortran provides an option to report memory leaks at
>>> runtime, like g95 did (implicitely) in the past:
>>>
>>> g95 output at the end of execution:
>>>
>>> Remaining memory: 4000 bytes at 000000000bf56338 allocated at line 4 of
>>> test.f90
>>>
>>> I found this thread where a patch is proposed, but can not find it in
>>> the gfortran (4.7.0) options
>>
>> I think there were some issues with the patch. It is still planed to
>> support it eventually, but it has not yet been implemented.
>>
>> However, you can use valgrind to find memory leaks, available at
>>
http://valgrind.org/ (It should work on all common platforms but
>> Windows.) As it is frequently used during development, there shouldn't
>> be any valgrind warnings or memory leaks due to the compiler itself.
>> (Except for some known issues with polymorphic variables.)
>
> Indeed, Valgrind... A quick run shows me that it is probably a bit too
> much for me. In particular it tracks the memory leaks in the system or
> external libraries my program in linked against. Ok it can probably be
> tuned, but this will take time to learn.