I understand the crucial importance of freeing memory when certain variables or arrays need to be reused later in the program, or may not be in use for a while. However, in my experience with scientific computing a lot of the code written is meant to be run as a job and produce results, rather than the case of conventional software (a web browser for instance) which is listening for user input not knowing how much memory may be required.
So if certain arrays and variables are used throughout the entire program is there any point to dedicating a section of the program before exiting that will deallocate the memory used? My understanding is the operating system will take all memory back from a terminated program anyways.
Looking forward to any thoughts and opinions on the subject.