很简单,做一个定时器,然后定时调用下面的函数即可:
public double GetProcessUsedMemory() { double usedMemory = 0;
usedMemory = Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0;
return usedMemory; }
Powered by: 博客园 Copyright © 2024 sunrack Powered by .NET 9.0 on Kubernetes