Skip to content

Conversation

@StephenMolloy
Copy link
Member

This pull request introduces enhancements to the System.Runtime.Caching library to support a new configuration parameter, physicalMemoryBytesAvailable, which allows finer control over memory pressure calculations. The changes primarily focus on extending configuration options, updating memory monitoring logic, and improving cross-platform compatibility.

Configuration Enhancements:

  • Added physicalMemoryBytesAvailable as a new configuration property in MemoryCacheElement, enabling direct specification of available physical memory for cache management.

Memory Monitoring Logic Updates:

  • Modified PhysicalMemoryMonitor to support the new physicalMemoryBytesAvailable parameter, allowing memory pressure calculations based on explicit memory values or GC thresholds.
  • Updated methods in MemoryCacheStatistics to initialize and manage the physicalMemoryBytesAvailable configuration parameter.

Cross-Platform Compatibility:

  • Added MemoryMonitor.Unix.cs to improve support for Unix-based platforms, leveraging GC memory info for physical memory calculations.
  • Adjusted GetCurrentPressure methods in PhysicalMemoryMonitor.Unix.cs and PhysicalMemoryMonitor.Windows.cs to use a legacy approach for backward compatibility.

@dotnet-policy-service
Copy link
Contributor

Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it.

@StephenMolloy StephenMolloy reopened this Aug 27, 2025
@dotnet-policy-service
Copy link
Contributor

Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it.

@dotnet-policy-service
Copy link
Contributor

Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it.

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

Successfully merging this pull request may close these issues.

1 participant