'Low Memory Warning on Windows (Event ID 2004)

I have a machine with Windows 10 Enterprise LTSB which dedicated to run an aplication in Delphi. There is no one another programs installed on that.

Lately, I've been faced with warnings about low memory on Windows and reports about that (ID 2004) on Event Viewer:

Windows Warning Low Memory

Event Viewer low memory (Event ID 2004)

When this happens, I've checked and there is no one process use a consider amount of memory.

Since then, I've started a investigation to know what happens and if my application have some fault that generate this behavior.

I've been trying to reproduce this kind of situation (low memory system detection) on Windows 10 with a test application in Delphi which generate some leak to force Windows warnings.

I've been increasing memory usage of process to high levels, as you can see below. There was a moment that I couldn't increase memory anymore:

Memory Increase of process on Resource Monitor

This includes the commit memory level too:

Commit Memory Size

However, I've never have seen the Windows warning message appears and the report of event ID 2004 neither. In my researchs on Windows documentation and another foruns, I've founded the follow information: for the Resource Exhaustion Detector to detect and report the low memory event, it's necessary that Commit Memory ratio be, at least, 85%. This is being reach by the test application, how can you see above. After system detect this, it reports top three consumers of commited memory, as we can read on the article below;

https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc774731(v=ws.10)?redirectedfrom=MSDN

For my tests, I've done another application with C#, generate some leaks too. The behavior is different when we talk about Windows memory management (when the leak increase to high levels, automatically, SO reduces it), but I cannot reach low memory warning too.

Does anyone have suggestions to how can I reproduce these behavior on Windows, with a Delphi application?

Thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source