- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page