I now doubt the role of the operating system in relation to the life cycle of the process. I am using Linux.
Suppose I have an application that creates a collection of objects on a heap using new. During the life of the application, I do not need to delete any of these objects, except when exiting the application or an exception, before exiting to perform the cleanup.
Suppose I do not call delete at the end of the application for all of these objects, does the OS usually restore / free the entire heap allocated to make it available again when the process terminates? If a process exits due to an exception or call to return or exit, does this always happen?
If so, it means that if I do not call delete, it will not affect the operation of the OS or other applications running on the machine. Correctly?
I usually use boost shared pointersor use delete, but I would just like to clarify this doubt in the context of OS / Linux
Regards AFG
source
share