-2
1
EDIT4 We now have an answer. Thank you for everyone participating in the test, esp Jamie. Since the answer was deleted, here's the short summary: Win10 introduces memory compression, making this kind of testing difficult and partially pointless. If (on Win8 x64) you try to disable pagefile and write a test app to allocate memory, you'll likely run into allocation fail long before the core is exhausted (Out of CC). What Jamie did was write an app to perform millions of small allocations that did in fact succeed of using every last scrap of ram with no low memory warning. So the mechanism simply does not exist on Win 8 anymore, if you disable pagefile, the first warning you will get is a crash.
WRT failing "normal size" memory allocation while having plenty of CC left is probably due to fragmentation.
With 8GB or 6GB windows 8.1 x64 machine you get a low memory warning if your free RAM drops below about 20% of the total system RAM amount (1.6GB and 1.2GB, respectively) AND there is no more space in the pagefile. If pagefile space is available, physical memory will be allocated into pagefile to keep the 20% or RAM in reserve. So if you're playing Skyrim with a lot of mods and get a low memory warning, you'll probably see the pagefile being completely full and a bit under 20% of RAM being available.
Has anyone tried what is the limit with a 16GB windows machine? Does it extend with no limit i.e. you would receive a low memory warning at 3.2GB?
The easiest way to try this is to disable pagefile altogether or set it to a low value (like 1GB) and then start several apps with high memory use and/or just use this little utility: http://www.soft.tahionic.com/download-memalloc/
I'd test this myself but I have no access to a PC with 16GB (or more!) ram.
In Win8.1 the actual memory use figure is a bit harder to see as performance monitor does not show you pagefile usage. But task manager gives you the "committed" value that shows total memory in use (including pagefile)
Edit: Process explorer system information is probably the best to monitor how memory is being used. Commit charge and limit is the relevant bit here, if you have no pagefile, Commit limit = RAM and you should get a low memory warning when you get ~81% commit charge.
Edit2: To make it even more unambiguous, here's a pseudocode for the two cases I'm asking about
Case A no limit how large the minimum free memory (available commit charge) can grow before warning is issued:
if (CC/CL) > 0.8 then print "low memory warning"
Case B The minimum free memory (available commit charge) is limited to some absolute value and no warning is issued before it is crossed:
if (CC/CL) > 0.8 and if (CL-CC) < 2048MB then print "low memory warning"
Edit3: It turns out Windows 10 compresses memory when it runs low enough on actual RAM. This naturally makes this test more difficult to perform. You'd can still exhaust the available ram to be sure but windows will compress malloc with zero values quite efficiently. In Win8.1 x64 and earlier it's a simple task.
update
I'm currently having the misfortune to have to use 4GB Windows 7 x64 box. In this system Windows tries to keep ~800MB of physical memory available. This is of course the familiar 20% slice. And it hurts a lot worse than the 1.6GB "reserve" on 8GB box.
I see moderator deleted my answer where I summarized Jamie's findings using a bespoke program written to exhaust the core. Thanks for that.
Downvoted because you know the answer, you just don't like it. The correct answer is not going to change, and you've already been given links to tons of evidence that you can get a low memory warning now matter how much RAM is free. – David Schwartz – 2015-12-03T20:56:23.247
Presume I know about "commit charge". – Barleyman – 2015-12-04T13:10:17.360
And actually I have no idea. Hence the question if the commit charge threshold is capped or not. To make it unambiguous case A :
if (CC / CL) == 0.8: print "low memory warning"
case B :if (CC / CL) == 0.8 and < 2048MB: print "low memory warning"
– Barleyman – 2015-12-04T16:54:26.740@DavidSchwartz We have an answer now. Which, incidentally, was not what I expected. It's also first piece of "evidence" I have seen as in someone actually went and tried it in a repeatable manner. – Barleyman – 2016-02-05T14:13:58.287
Alas Barleyman has come to the wrong conclusion. Barleyman concluded that the warning doesn't exist as of Windows 8. But it didn't exist before, either. The "low memory" warning has always pertained to commit charge, not RAM. Because of the way the commit limit works, Windows will simply not let programs allocate virtual memory for which there is no physical storage. If too much of the "physical storage" is on disk rather than RAM, the system will slow down, perhaps catastrophically, but there's no warning. The commit limit has always worked this way. – Jamie Hanrahan – 2019-03-06T12:00:13.480
@JamieHanrahan Back after a four years' break? I had no access to Win7 machine at the time so therefore no mention of them. The commit limit is remarkably consistent at when it triggers unless someone writes a synthetic test application like the one you did. There's also the remarkably stable percentage of core that the system wants to keep un-allocated when page file is available, whatever the exact mechanism is. Anyways, thanks for helping to figure it out back in the day, instead of dithering about terminology. – Barleyman – 2019-03-07T12:45:21.567
I think I have finally "grokked" what you're getting at. The question title asked about the "low memory warning' threshold. Well, that is, and remains, about attempts to commit virtual memory beyond the commit limit. But what triggers aggressive shrinkage of process working sets is a different threshold of a different metric entirely (that of available RAM). They just appear related because it's tough to reach the commit limit without also putting a lot of RAM in use. However, I think I can tweak my little random memory-user to do it, just by switching to file mapping. – Jamie Hanrahan – 2019-03-11T21:43:44.970
@JamieHanrahan I believe you already managed to get pretty close to having 100% of memory used so it's indeed possible to do but unlikely to happen in real life use scenario. In any case the Windows 10 memory compression changes the play in any case. – Barleyman – 2019-03-18T14:02:24.500
My thought was not about getting closer to 100% RAM In Use, but to do so without using much commit charge.As for memory compression, it only applies to stuff on the modified page list, and even then, only to stuff that would be backed by the page file (i.e. private commit). It doesn't apply to mapped files, so changing the memory-hog test app to use mapped files instead of pagefile-backed private commit means that memory compression won't be affecting the results. – Jamie Hanrahan – 2019-03-19T05:48:27.760