+ 2

Memory leak

Let's say I have a recursive function in c/c++ program where I'm allocating MB's of memory and not freeing it. The program closes abruptly and the allocated memory is not freed. So my question is, is that memory remain unusable? If the run the program multiple times with result( program crashes resulting in memory leak), eventually will it cause OS crash??

13th Jun 2018, 12:17 PM
Dilip Srinivas
Dilip Srinivas - avatar
1 Answer
+ 2
No... On common computer system this is managed by OS that make again "usable" this memory Note that i have simplify answer because much depend on OS that abstract you from many concepts in computer system (process managements, virtual memory etc)
13th Jun 2018, 1:01 PM
KrOW - avatar