Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do memory deallocation routines touch the block being freed?

Tags:

Windows HeapFree, msvcrt free: do they cause the memory being freed to be paged-in? I am trying to estimate if not freeing memory at exit would speed up application shutdown significantly.

NOTE: This is a very specific technical question. It's not about whether applications should or should not call free at exit.

like image 967
Constantin Avatar asked Feb 02 '09 10:02

Constantin


1 Answers

If you don't cleanly deallocate all your resources at application shutdown it will make it nigh on impossible to detect if you have any really serious problems - like memory leaks - which would be more of a problem than a slow shut down. If the UI disappears quickly, then the user will think the it has shut down quickly even if it has a lot of work still to do. With UI, perception of speed is more important than actual speed. When the user selects the 'Exit Application' option, the main application window should immediately disappear. It doesn't matter if the application takes a few seconds after that to free up everything an exit gracefully, the user won't notice.

like image 169
Skizz Avatar answered Sep 28 '22 05:09

Skizz