Virtual Machine Memory Management via Threshold-Based Recovery

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Applications running in virtual machines often face severe memory issues, leading to 'out of memory' exceptions, which can cause crashes and data inconsistencies, and existing memory management techniques are either reactive or inefficient, with garbage collection adding CPU overhead and not effectively preventing memory leaks.

Innovation Solution

A proactive system that monitors memory usage and garbage collector activity, pre-allocates memory for recovery, and adjusts application processing based on thresholds to prevent memory exhaustion, using a monitoring API and garbage collector to dynamically optimize memory usage and reduce CPU load.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Quantity of substance

If a garbage collector program is activated to reclaim memory, then memory availability is improved, but CPU overhead increases

Engineering Contradiction:
Improvememory availabilityVSAvoidCPU overhead
Core Design Contradiction:
Quantity of substanceVSUse of energy by moving object

Solution Approach 1:

The system pre-allocates a memory block at application start-up that can be quickly released when memory pressure is detected. This preliminary preparation allows immediate memory availability without waiting for garbage collection cycles, thus avoiding the CPU overhead of frequent GC activation while ensuring memory can be freed when needed.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The application is empowered to manually free the pre-allocated memory block when it detects memory pressure conditions, rather than relying entirely on the garbage collector. This self-service approach allows the application to control memory release timing and avoid unnecessary GC CPU overhead while maintaining memory availability.

Inventive Principle:
Principle #25Self-service

2Reliability

If memory is pre-allocated at application start-up for recovery, then recovery capability is improved, but memory availability during normal operation decreases

Engineering Contradiction:
Improverecovery capabilityVSAvoidmemory availability
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The system dynamically adjusts memory allocation between the application and the pre-allocated block based on runtime conditions. The pre-allocated block starts with a portion of available memory, but the application can request additional memory from the virtual machine when needed, and the system balances these allocations to maintain both recovery capability and operational memory availability.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The system changes the state of the pre-allocated memory block between being held (for recovery) and released (for operation). When memory pressure is detected, the block is released to improve availability; when stability is needed, it is held to maintain recovery capability. This parameter change allows the system to adapt to different operational requirements.

Inventive Principle:
Principle #35Parameter changes

3Quantity of substance

If the garbage collector de-fragments memory space, then large free memory blocks are created, but execution time increases

Engineering Contradiction:
Improvefree memory block sizeVSAvoidexecution time
Core Design Contradiction:
Quantity of substanceVSLoss of time

Solution Approach 1:

The pre-allocated memory block serves as a ready-made large free memory block available immediately at application start-up. This eliminates the need to wait for garbage collector de-fragmentation cycles to create large free blocks, thus avoiding the execution time penalty while ensuring large memory blocks are available when needed.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS8886866B2Optimizing memory management of an application running on a virtual machine
Publication Date: 2014.11.11 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US8886866B2 patent drawing
  • US8886866B2 patent drawing
  • US8886866B2 patent drawing

AI summary

A method, system and computer program product for optimizing memory usage of an application running on a virtual machine. A virtual machine memory block is pre-allocated and the average memory usage of the virtual machine is periodically computed using statistics collected from the virtual machine through an API. If the memory usage average becomes higher than a maximum threshold, then a recovery mode is entered by releasing the virtual machine memory block and forcing the running application to reduce its processing activity; optionally, a garbage collector cycle can be forced. If the computed memory usage average becomes lower than a minimum threshold value, which is lower than the maximum threshold value, then a normal mode is entered by re-allocating the virtual machine memory block and forcing the running application to resumes its normal processing activity. Optionally, when the virtual machine is idle, a deep garbage collection is forced.