It ' s per-process. Once your process exits, the allocated memory is returned to the OS for use by other processes (new or existing).
To answer your edited question, there's only a finite amount of memory in your machine. So if you had a memory leak, then the major problem was that the memory isn ' t available for other processes to us E. A secondary, but not negligible, effect are that your process image grows, you'll swap to disc and performance would be H It. Finally your program would exhaust all the memory in the system and fail, since it's unable to allocate any memory for Itse Lf.
It's arguable that for a small process with a short lifetime, memory leaks is tolerable, since the leaked memory would be Small in quantity and short-lived.
Take a look at this resource, for possibly more info than you ll ever need. What do we ' re discussing here is dynamic or heap allocation.
malloc without free, what happens?