Reputation: 19
I have been started learning C++. Now when I came across dynamic memory allocation I heard of pointers... But in this concept there is a problem of memory leak. So my confusion is... When we restart our PC, does heap memory gets freed, which remained allocated while the program's run ?
Upvotes: 0
Views: 1244
Reputation: 19
I have found solution to this problem.
When you restart your PC, all the problem of memory leak is solved by your operating system.
So, don't worry, operating systems these days are smart enough to solve such issues by themselves. If your are facing any lag in your system. Just restart your PC. All the memory will be freed!!
Upvotes: 1