First test is with an Azure Windows 2016 server with 8 vCPUs, 14 GB RAM, HDD.
After a few instances:
After 30 instances:
As you can see, private byes and working set of some instances reduced a lot. Based on what I read from how memory is managed (aka working set, physical memory, virtual memory, page files...), I can understand how the OS can take physical memory away from some idle processes for the others that are in need. So far so good.
Then we tested the same scenario with another Azure Windows 2016 server with 4 vCPUs, 16 GB RAM, but this one uses SSD.
After about 20 instances, we got OutOfMemoryException:
The key difference I could see is that memory of all those w3wp processes were still high. In other words, they were not reduced as in the test above.
My question is why the behaviors were different? What prevented the second cases from saving memory to page file (my guess!) and thus caused OutOfMemoryException?
1 Answer
Checking pagefile setting showed us that it was stilled enabled in "System managed size" mode but somehow Windows refused to use it for the w3wp processes. We tried to change it to custom size and set it to 20 GB and everything started working again as expected.
I must admit that I still don't know why Windows 2016 behaves like that when SSD is used though.
-
Thuan, I am running into the same problem on a non-Azure Windows 2016 server (no SSDs) Hyper-V VM.
My pagefile is set to "System managed size" with plenty of disk space and memory.
The 2016 config seem to be exactly the same as my 2012 R2 web servers, but in the 2016 server the page file is not growing.
Either that or the w3wp processes are refusing to use the page file as you described.
I solved this temporarily by changing the "Idle timeout action" from suspend to terminate so that low traffic sites don't get paged out to disk.
Any chance you made further progress on this? -
@john The only thing I tried and worked for me was to change paged file mode to "Custom size". Other than that, I don't know what else could work :)
南来地,北往的,上班的,下岗的,走过路过不要错过!
======================个性签名=====================
之前认为Apple 的iOS 设计的要比 Android 稳定,我错了吗?
下载的许多客户端程序/游戏程序,经常会Crash,是程序写的不好(内存泄漏?刚启动也会吗?)还是iOS本身的不稳定!!!
如果在Android手机中可以简单联接到ddms,就可以查看系统log,很容易看到程序为什么出错,在iPhone中如何得知呢?试试Organizer吧,分析一下Device logs,也许有用.
We had to change it from managed by Windows to a fixed pagefile size, e.g. 20 GB and things started working as we expected. – Thuan Feb 15, 2018 at 15:57