Dangers of _exit () - memory leak?

Sorry for repeating the question that was asked several times, but I could not find a specific mention of memory problems. if a process terminates with _exit (0) or _Exit (0), can its memory block be lost for the OS? Thanks, -nuun

+3
source share
3 answers

For any consumer O / S that does not happen. Modern multiprocessor operating systems will free up any resources that a process can receive (memory, locks, open files, etc.) when the process ends. Therefore, I usually feel that a memory or resource leak is not “considered” a leak if I just acquire them at startup (not at runtime, possibly repeatedly).

However, there are still many built-in / real-time platforms for which this is not true. If your program can be run on one of them, you should be scrupulous about releasing acquired resources. But even there, it is often easier to simply reboot the device after each use ...

+4
source

- O/S (Unix, Windows, ) - O/S , , , .

+4

In general, no. Operating systems process this material for us.

0
source

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


All Articles