When the process ends, will the returned memory be restored to the OS?

I am wondering if I'm new to some object, but forget to delete it when the process comes out, will there be a memory leak in the OS?

+3
source share
2 answers

This does not ask the C ++ question as an operating system question.

All operating systems that I know of will return the normal memory that was allocated. This is because the distribution usually comes from the private address space of the processes, which will be returned upon exit.

, . , , , ( , ).

+7

( Unix , x86) ( malloc C, new/delete ++). , , .

+1

Source: https://habr.com/ru/post/1723066/


All Articles