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

How Intel Fortran handles allocated memory during crash

Feng__Jesse
새로운 기여자 II
457 조회수

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 포인트
1 응답
Steve_Lionel
명예로운 기여자 III
448 조회수

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 포인트
응답