Two-Tier Adaptive Heap Management for JVM Memory Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In Java virtual machine environments, high -Xmx values lead to out-of-memory errors, swapping, and long garbage collection pauses, limiting the number of virtual machines that can be run on a host without causing performance degradation.

Innovation Solution

Implementing a two-tier adaptive heap management system that divides the heap into a normal tier for minimizing pause times and a high-heap tier for aggressive compaction and memory release, allowing for a soft limit and a red zone where memory can be shared with other virtual machines.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If a high -Xmx value is set to avoid out-of-memory errors, then the virtual machine can handle higher loads, but swapping and long garbage collection pauses occur which degrade performance

Engineering Contradiction:
Improveload handling capabilityVSAvoidJVM performance
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The heap is divided into two distinct tiers: a first tier for normal operations with standard garbage collection policies that minimize pause time, and a second tier for high-heap conditions with aggressive compaction and memory release policies. This segmentation allows the system to optimize for different operational states separately, resolving the contradiction between handling high loads and maintaining performance.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The garbage collection policy dynamically adapts based on the current heap usage state. When the heap enters the second tier (high-heap condition), the system transitions to aggressive compaction and memory release policies. This dynamic adjustment allows the JVM to maintain high load handling capability while minimizing swapping and GC pauses through state-dependent optimization.

Inventive Principle:
Principle #15Dynamics

2Adaptability or versatility

If a high -Xmx value is set to maximize memory availability, then more virtual machines can run on a host, but the number of JVMs that can be run without causing swapping is reduced

Engineering Contradiction:
Improvenumber of virtual machines per hostVSAvoidswapping avoidance
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

By segmenting the heap into two tiers with different garbage collection policies, the system can allow more virtual machines to run on a host while avoiding swapping. The second tier's aggressive memory release policy ensures that when memory pressure occurs, the system quickly releases unused memory back to the OS, preventing swapping even when multiple JVMs are running.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system changes the garbage collection parameters dynamically based on heap usage. When in the second tier, the system employs aggressive compaction and memory release parameters that quickly return memory to the OS. This parameter adjustment allows the host to support more virtual machines while maintaining reliability by avoiding swapping through rapid memory release.

Inventive Principle:
Principle #35Parameter changes

3Loss of time

If incremental heap compaction is used to avoid affecting garbage collection pause time, then GC pause time is minimized, but the JVM stays at high heap usage for a long time increasing swapping probability

Engineering Contradiction:
Improvegarbage collection pause timeVSAvoidswapping probability
Core Design Contradiction:
Loss of timeVSProductivity

Solution Approach 1:

The heap is segmented into two tiers with different compaction strategies. The first tier uses incremental compaction to minimize GC pause time during normal operations. The second tier uses aggressive compaction that quickly releases memory to the OS, reducing swapping probability. This segmentation allows the system to optimize for either minimal pause time or reduced swapping based on operational context.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The compaction strategy dynamically switches based on heap usage state. During normal operations, the system uses incremental compaction to minimize pause time. When the heap enters the second tier (high-heap condition), the system transitions to aggressive compaction that rapidly releases memory. This dynamic switching resolves the contradiction by selecting the appropriate compaction strategy based on current system state.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS9448928B2System and method for two-tier adaptive heap management in a virtual machine environment
Publication Date: 2016.09.20 ORACLE INT CORP
  • US9448928B2 patent drawing
  • US9448928B2 patent drawing
  • US9448928B2 patent drawing

AI summary

In accordance with an embodiment, described herein is a system and method for two-tier adaptive heap management (AHM) in a virtual machine environment, such as a Java virtual machine (JVM). In accordance with an embodiment, a two-tier AHM approach recognizes that more virtual machines can be run on a particular host, or the same number of virtual machines can support higher load while minimizing out-of-memory occurrences, swapping, and long old garbage collection pauses, if the heap is divided into tiers, so that a garbage collection policy that minimizes pause time can be used in a first (normal) tier, and a garbage collection policy that favors heap compaction and release of free memory to the host can be used in another (high-heap) tier.