yoi*_*cis 18 .net c# memory multithreading
我有一个在C#中使用线程的程序.有没有办法以编程方式了解应用程序的内存使用情况?我想限制线程的产生说10兆字节的内存,我该怎么做?
bin*_*bob 24
如果你想要整个运行进程的内存而不是每个线程,那么如何:
// get the current process
Process currentProcess = System.Diagnostics.Process.GetCurrentProcess();
// get the physical mem usage
long totalBytesOfMemoryUsed = currentProcess.WorkingSet64;
Run Code Online (Sandbox Code Playgroud)
还有一大堆其他进程内存属性,除了WorkingSet64在下面的链接中查看"内存相关" 属性,以获得最适合的内容
http://msdn.microsoft.com/en-us/library/system.diagnostics.process_properties.aspx
| 归档时间: |
|
| 查看次数: |
25175 次 |
| 最近记录: |