Skip to content
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

Closed
mrahl opened this issue Nov 8, 2017 · 7 comments

Comments

@mrahl
Copy link

mrahl commented Nov 8, 2017

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.

@richlander
Copy link
Member

@lt72, @brianrob Can you take a look?

@brianrob
Copy link
Member

This looks like an issue in System.Web.Hosting.

@sajayantony, do you know who a good contact for this is?

@HongGit
Copy link
Member

HongGit commented Nov 14, 2017

ASP.NET has bug opened tracking this issue, 523523.

@richlander
Copy link
Member

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?

@HongGit
Copy link
Member

HongGit commented Nov 15, 2017

Let's keep this one.

@mrahl
Copy link
Author

mrahl commented Apr 17, 2018

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

@leecow
Copy link
Member

leecow commented Jan 5, 2021

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

@leecow leecow closed this as completed Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants