简体   繁体   English

在visual studio中调用垃圾收集

[英]Call garbage collect in visual studio

Is it possible, to say the gc to collect during debugging session via Visual Studio 2015 Enterprise? 是否可以说,通过Visual Studio 2015 Enterprise在调试会话期间收集gc?

I want to observe the memory usage of my application when calling GC.Collect() , but only for some debugging reasing. 我想在调用GC.Collect()时观察我的应用程序的内存使用情况,但仅用于某些调试reasing。 So calling it from Visual Studio during debugging the app would be very helpful. 因此,在调试应用程序期间从Visual Studio调用它将非常有用。

Thank you very much! 非常感谢你!

您可以在立即窗口中编写GC.Collect()

在断点期间,您可以使用“即时窗口”发出命令,只需执行GC.Collect()

You can use the Visual-Studio Shortcut for Tools.ForceGC: 您可以使用Tools.ForceGC的Visual-Studio快捷方式:

Press Ctrl+Shift+Alt+F12, Ctrl+Shift+Alt+F12 Ctrl+Shift+Alt+F12, Ctrl+Shift+Alt+F12

Doku and more Shortcuts for VS 2015 see: https://msdn.microsoft.com/en-us/library/da5kh0wa.aspx Doku和VS 2015的更多快捷方式请参阅: https//msdn.microsoft.com/en-us/library/da5kh0wa.aspx

Solution found here: https://blogs.msdn.microsoft.com/camerons/2010/12/15/force-vs-to-garbage-collect/ 解决方案在此处找到: https//blogs.msdn.microsoft.com/camerons/2010/12/15/force-vs-to-garbage-collect/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM