Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28385 Discussions

How Intel Fortran handles allocated memory during crash

Feng__Jesse
New Contributor I
154 Views

Before the variables are all defined with a fixed length. I started implementing allocatable variables in my code and learned that Fortran needs explicit deallocation. Then it prompt me to wonder what happens to the allocated memory when the code crashes? If I have a code that crashes often, does that mean there would be a lot of memory leaks until the computer restarts and resets the memory?

0 Kudos
1 Reply
Steve_Lionel
Honored Contributor III
145 Views

No - all memory allocated gets freed when the executable exits, no matter how. Also, Fortran doesn't "need" explicit deallocation. Local, non-SAVEd allocatable variables are automatically deallocated when a routine exits. (This is not true for pointers.)

0 Kudos
Reply