SystemEvents.LowMemory 事件
定义
注意
This event has been deprecated. http://go.microsoft.com/fwlink/?linkid=14202
注意
This event has been deprecated. https://go.microsoft.com/fwlink/?linkid=14202
注意
此 API 现已过时。
当系统用完可用 RAM 时发生。Occurs when the system is running out of available RAM.
public:
static event EventHandler ^ LowMemory;
[System.ComponentModel.Browsable(false)]
[System.Obsolete("This event has been deprecated. http://go.microsoft.com/fwlink/?linkid=14202")]
public static event EventHandler LowMemory;
[System.ComponentModel.Browsable(false)]
[System.Obsolete("This event has been deprecated. https://go.microsoft.com/fwlink/?linkid=14202")]
public static event EventHandler LowMemory;
[System.ComponentModel.Browsable(false)]
[System.Obsolete("This event has been deprecated. https://go.microsoft.com/fwlink/?linkid=14202")]
public static event EventHandler? LowMemory;
public static event EventHandler LowMemory;
[System.ComponentModel.Browsable(false)]
[System.Obsolete("")]
public static event EventHandler LowMemory;
[<System.ComponentModel.Browsable(false)>]
[<System.Obsolete("This event has been deprecated. http://go.microsoft.com/fwlink/?linkid=14202")>]
member this.LowMemory : EventHandler
[<System.ComponentModel.Browsable(false)>]
[<System.Obsolete("This event has been deprecated. https://go.microsoft.com/fwlink/?linkid=14202")>]
member this.LowMemory : EventHandler
member this.LowMemory : EventHandler
[<System.ComponentModel.Browsable(false)>]
[<System.Obsolete("")>]
member this.LowMemory : EventHandler
Public Shared Custom Event LowMemory As EventHandler
事件类型
- 属性
例外
当前上下文不支持系统事件通知。System event notifications are not supported under the current context. 例如,服务器进程可能不支持全局系统事件通知。Server processes, for example, might not support global system event notifications.
创建系统事件窗口线程的尝试未成功。The attempt to create a system events window thread did not succeed.
注解
此事件包装 WM_COMPACTING 消息。This event wraps the WM_COMPACTING message. 当系统检测到超过30到60秒的时间间隔内的系统时间超过12.5% 时,会将此消息发送到所有顶级窗口。This message is sent to all top-level windows when the system detects more than 12.5 percent of system time over a 30- to 60-second interval is being spent compacting memory. 这表明系统内存不足。This indicates that system memory is low.
备注
仅当消息泵正在运行时才引发此事件。This event is only raised if the message pump is running. 在 Windows 服务中,除非使用隐藏的窗体或手动启动了消息泵,否则将不会引发此事件。In a Windows service, unless a hidden form is used or the message pump has been started manually, this event will not be raised. 有关演示如何使用 Windows 服务中的隐藏窗体处理系统事件的代码示例,请参阅 SystemEvents 类。For a code example that shows how to handle system events by using a hidden form in a Windows service, see the SystemEvents class.
注意
因为这是一个静态事件,所以必须在释放应用程序时分离事件处理程序,否则会导致内存泄漏。Because this is a static event, you must detach your event handlers when your application is disposed, or memory leaks will result.
调用方说明
提供此消息只是为了与基于 Windows 的16位应用程序兼容。This message is provided only for compatibility with 16-bit Windows-based applications.