|
|
|
|
|
by ars
5184 days ago
|
|
If you allocate memory "after" that memory, it's not possible to return the earlier memory to the OS. Also, suppose you need the memory only for startup and shutdown (things like logfiles, network connections, command line parsing, etc). |
|
Things like network connections, logfiles are used all the time, so they won't be swapped out (actually file handles are kernel side so never swapped anyway). You can free the command line parse after setting the options.
And clean shutdown is overrated: long running programs can just terminate fairly gracelessly if necessary, the OS cleans everything up.