![](/img/trans.png)
[英]Debugging from visual studio does not find file next to executable. When program ran manually, it does
[英]Does Visual Studio clean up memory automatically when it stop debugging a program?
我使用的是Visual Studio 2015,但我希望每個版本都提供通用答案。
如果我的代碼存在內存泄漏,並且在Visual Studio( F5
)中以退出值= 0運行:
如果我的代碼保留了一些堆內存 ,那么在我的代碼可以適當地釋放內存之前,我先按紅色的矩形按鈕( stop
)來終止它:
我注意到我的程序在按下幾個run->red button
后逐漸變慢,而在重新啟動計算機后又變得更快。 這可能只是我的想象-或與GPU有關。
但是,我還記得多次run->allocate 10MB->red button
情況,對以后的運行沒有任何影響。
沒有。
程序退出時, 無論它如何退出 ,操作系統都會釋放程序的內存。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.