cppBeginner
cppBeginner

Reputation: 1212

Does Visual Studio clean up memory automatically when it stop debugging a program?

I am using Visual studio 2015, but I prefer a generic answer for every version.

If my code has memory leak and it run with exit value = 0 inside Visual Studio (F5):-

If my code reserve some heap memory, then I terminate it by pressing the red rectangle button (stop) before my code can release memory appropriately :-

I notices my program slow down gradually after several run->red button, and become faster again after I restart my computer. It might be just my imagination - or GPU-related.

However, I also remember a case of run->allocate 10MB->red button several times without any impact on performance of later runs.

Upvotes: 2

Views: 3428

Answers (1)

No.

When the program exits, no matter how it exits, the operating system will free the program's memory.

Upvotes: 4

Related Questions