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

How Intel Fortran handles allocated memory during crash

New Contributor II

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
Honored Contributor III

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