-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP runtime cache memory monitor fails to start under certain conditions in 4.7.1 #552
Comments
This looks like an issue in System.Web.Hosting. @sajayantony, do you know who a good contact for this is? |
ASP.NET has bug opened tracking this issue, 523523. |
The link above is to the private Microsoft bug tracker. @HongGit is there a public GH issue you can use or do you want this one to be that? |
Let's keep this one. |
I see that these bugs, registered as 53157 and 531576, are fixed in the upcoming .net framework 4.7.2: https://github.com/Microsoft/dotnet-framework-early-access/blob/master/release-notes/build-3052/dotnet-build-3052-changes.md |
Looks like the mentioned issues are possibly fixed. This repo is no longer actively monitored. Closing up old issues that have not had activity in while. If this is still an issue, please open a new issue in an appropriate repo listed in microsoft/dotnet#1275 |
I think I have found two issues in LowPhysicalMemoryMonitor that prevent the periodic memory monitor / cache scavenging thread from running. That means memory usage can go beyond configured thresholds, and beyond threshold for Proactive Auto Heal in Azure Web Apps, causing unnecessary recycles.
Issue 1: Timer is not started if memory pressure at startup is at certain level and PrivateBytesPollTime has default value
If the memory usage at the time of application startup fulfills the condition PressureHigh > PressureLast > PressureLow / 2, the Timer driving the periodic check/scavenging is never started (it is instantiated as stopped).
This happens because LowPhysicalMemoryMonitor.AdjustTimer (called from LowPhysicalMemoryMonitor.Start to start the timer) in this scenario determines that no update is required to the timer interval, unless LowPhysicalMemoryMonitor.s_pollInterval is less than 30 seconds. The s_pollInterval is initialized according to the CacheSection.PrivateBytesPollTime setting, which defaults to 2 minutes.
The timer therefore remains stopped, unless you apply the workaround: Setting PrivateBytesPollTime to less than 30 seconds.
Issue 2: Timer is suddenly stopped if PercentagePhysicalMemoryUsedLimit has default value
If no value is specified for for CacheSection.PercentagePhysicalMemoryUsedLimit, LowPhysicalMemoryMonitor will not initialize the s_pollInterval field with any value. It will therefore be 0, which will cause the Timer to stop when the periodic check calls LowPhysicalMemoryMonitor.AdjustTimer and the condition PressureHigh > PressureLast > PressureLow / 2 is again met.
The text was updated successfully, but these errors were encountered: