G1 GC: Implement Core AHS Control Loop Components

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Unresolved
    • Priority: P3
    • tbd
    • Affects Version/s: None
    • Component/s: hotspot
    • gc

      Implements core components of the G1 Adaptive/Automatic Heap Sizing (G1-AHS) control loop based on CPU time feedback. This enhancement adds a feedback-based control system that automatically adjusts heap size based on GC overhead and application behavior.

      Key Features:
      1. CPU-time based Control Loop:
         - Target GC CPU ratio from GCTimeRatio
         - Configurable damping factor (α) for stability
         - SoftMaxHeapSize support with 25% CPU cap

      2. Memory Pressure Management:
         - GC thrashing detection (>25% overhead)
         - Adaptive heap growth during thrashing with high mutator activity
         - Hysteresis for uncommit decisions
         - Reserve space management

      3. Workload Analytics:
         - Tracks mutator CPU usage with moving average
         - Monitors GC overhead trends
         - Adjusts heap target based on workload characteristics

      4. Marking Integration:
         - IHOP threshold coordination
         - Marking cycle awareness
         - SoftMax-aware threshold updates
         - Concurrent marking synchronization

      Implementation Strategy: Core Control Loop:
         - Heap target computation from GC CPU ratio
         - State management
         - Debug logging for decisions
         - Integration with existing ergonomics

      Testing:
      - Unit tests for control components
      - Stress tests for thrashing detection
      - Long-running application scenarios
      - GC overhead validation

      Files Changed:
      - hotspot/share/gc/g1/g1HeapSizingPolicy.hpp
      - hotspot/share/gc/g1/g1HeapSizingPolicy.cpp

      Documentation:
      https://github.com/microsoft/openjdk-workstreams/blob/main/G1-AHS/README.md

      Motivation:
      The implementation provides dynamic heap sizing that:
      1. Reduces manual tuning needs
      2. Adapts to application behavior
      3. Handles memory pressure gracefully
      4. Improves container support

            Assignee:
            Monica Beckwith
            Reporter:
            Monica Beckwith
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: