windows c#低内存通知 [英] windows c# low memory notification

查看:66
本文介绍了windows c#低内存通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


如何从c#订阅Windows低内存通知?

How do I subscribe to Windows Low memory notification from c# ?


我们的c#app有大量非托管内存分配,如果操作系统内存可用性低,我们可以释放。

our c# app has substantial unmanaged memory allocation, which we can free if OS memory availability is low.





推荐答案

嗨Portoal,

Hi Portoal,

感谢您在此发帖。

对于您的问题,Microsoft提供了  ; SystemEvents.LowMemory要通知  可用RAM。但现在,API已经 已过时。

For your question, Microsoft provided SystemEvents.LowMemory Event to notify the out of available RAM. But now, the API is obsolete.

https://docs.microsoft.com/en-us/dotnet/api/ microsoft.win32.systemevents.lowmemory?view = netframework-4.7.2

您可以从以下链接下载源文件以检查  RAM内存大小。 

You could download the source file from the link below to check the RAM Memory Size. 

https://code.msdn.microsoft.com/windowsdesktop/C-Console-Program-to-Check-b3f71c4c

然后设置限制,当Windows内存达到限制时,会向您发送通知。

And then set a limit, when Windows memory achieve the limit, sent you a notification.

最好的问候,

Wendy


这篇关于windows c#低内存通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆