JVM Heap Memory Region Segmentation for Selective Garbage Collection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional garbage collection processes in JVMs suspend all threads except the garbage collection thread, leading to prolonged service disruptions and increased response times due to the need to clear the entire heap memory, affecting the ability of application programs to provide external services.

Innovation Solution

Implementing a resource reclamation method that allows for selective memory region reclamation in the JVM, where only the memory region corresponding to a target tenant is reclaimed, enabling other tenants' threads to continue running and providing services without interruption.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of energy

If the entire heap memory is reclaimed during garbage collection, then memory resources are fully released, but all program threads are suspended and service disruption time increases

Engineering Contradiction:
Improvememory resource utilizationVSAvoidservice disruption time
Core Design Contradiction:
Loss of energyVSLoss of time

Solution Approach 1:

The heap memory is divided into multiple memory regions, each corresponding to different tenants. The garbage collection process is segmented to reclaim only the memory region of the target tenant instead of the entire heap memory. This segmentation allows selective reclamation of memory resources while leaving other tenants' memory regions untouched, thus suspending only the target tenant's threads rather than all threads, which reduces service disruption time while still achieving memory resource release.

Inventive Principle:
Principle #1Segmentation

2Loss of energy

If the entire heap memory is reclaimed during garbage collection, then memory resources are fully released, but system responsiveness decreases due to full suspension

Engineering Contradiction:
Improvememory resource utilizationVSAvoidsystem responsiveness
Core Design Contradiction:
Loss of energyVSProductivity

Solution Approach 1:

The heap memory is divided into multiple memory regions corresponding to different tenants. The garbage collection process targets only one specific memory region at a time rather than the entire heap. This segmentation enables the system to release memory resources incrementally while maintaining responsiveness, as only the target tenant's threads are suspended during each collection cycle while other tenants continue to serve requests normally.

Inventive Principle:
Principle #1Segmentation

3Loss of time

If selective memory region reclamation is performed, then service disruption time is reduced, but memory resource release may be incomplete

Engineering Contradiction:
Improveservice disruption timeVSAvoidmemory resource release completeness
Core Design Contradiction:
Loss of timeVSLoss of energy

Solution Approach 1:

The garbage collection process is performed periodically on different tenant memory regions in a cyclic manner. Instead of suspending all threads once to reclaim the entire heap memory, the system performs multiple shorter collection cycles, each targeting a different tenant's memory region. Over time, this periodic selective reclamation achieves complete memory resource release while minimizing service disruption at any given moment, as each individual collection cycle affects only one tenant.

Inventive Principle:
Principle #19Periodic action

Data Source

PatentEP3583504B1Resource reclamation method and apparatus
Publication Date: 2023.11.15 ALIBABA GROUP HOLDING LTD
  • EP3583504B1 patent drawingFigure 1
  • EP3583504B1 patent drawingFigure 2
  • EP3583504B1 patent drawingFigure 3

AI summary

Embodiments of the application provide a resource reclamation method and a resource reclamation apparatus. The method includes: determining a memory region corresponding to a target tenant included by a heap memory as a target region; and performing resource reclamation on the target region to release the target region.