Dynamic Memory Allocation for Heap Fragmentation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional memory allocation methods in operating systems lead to memory fragmentation and inefficient heap management, particularly for applications that allocate and deallocate small chunks of memory, resulting in unused 'holes' and inability to shrink the heap, leading to suboptimal memory usage under pressure.

Innovation Solution

Dynamic memory allocation involves dividing memory into smaller, fixed-size heaps that can be allocated and deallocated as needed, allowing for efficient reuse of memory by monitoring and releasing empty or hole-filled heaps, without requiring changes to applications.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Device complexity

If a single heap is allocated to an application, then memory allocation is simple, but memory fragmentation occurs over time

Engineering Contradiction:
Improvememory allocation structureVSAvoidmemory usage efficiency
Core Design Contradiction:
Device complexityVSReliability

Solution Approach 1:

The patent divides the single heap into multiple smaller heaps (e.g., heap1, heap2, heap3) that can be independently managed. Each heap can be allocated and deallocated separately, allowing the system to reduce fragmentation by releasing and reallocating individual heaps rather than managing one large heap, thus improving memory usage efficiency while maintaining allocation simplicity through automated management

Inventive Principle:
Principle #1Segmentation

2Ease of operation

If heap memory is resident set memory, then memory is available to the application, but the whole heap must be swapped out under memory pressure

Engineering Contradiction:
Improvememory accessibilityVSAvoidmemory swap overhead
Core Design Contradiction:
Ease of operationVSLoss of energy

Solution Approach 1:

By segmenting the heap into multiple smaller heaps, the system can selectively swap out only the heaps that are not currently in use rather than swapping out the entire heap. This reduces the amount of data that needs to be written to disk under memory pressure, thereby reducing swap overhead and energy consumption while maintaining easy memory accessibility for active portions of the heap

Inventive Principle:
Principle #1Segmentation

3Reliability

If malloc_trim() is used to reduce fragmentation, then memory holes are reduced, but the operation is computationally intensive

Engineering Contradiction:
Improvememory fragmentation levelVSAvoidcomputational cost
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The patent uses segmentation to divide the heap into multiple smaller heaps that can be independently managed. This eliminates the need for computationally intensive fragmentation repair operations like malloc_trim() because the segmented structure naturally allows for easier memory reclamation and reallocation without requiring complex compaction algorithms to fix fragmentation issues

Inventive Principle:
Principle #1Segmentation

4Speed

If the heap cannot be re-organized, then memory allocation is fast, but the heap cannot shrink even when memory is freed

Engineering Contradiction:
Improvememory allocation speedVSAvoidheap size flexibility
Core Design Contradiction:
SpeedVSAdaptability or versatility

Solution Approach 1:

The patent segments the heap into multiple smaller heaps that can be independently allocated and deallocated. This segmentation enables the heap structure to adapt its total size dynamically - when memory is freed from one or more heaps, those heaps can be deallocated and reallocated to other applications, allowing the original application to effectively shrink its memory footprint without requiring reorganization of the entire heap structure

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS8296542B2Dynamic memory allocation for applications
Publication Date: 2012.10.23 RED HAT INC
  • US8296542B2 patent drawing
  • US8296542B2 patent drawing
  • US8296542B2 patent drawing

AI summary

Some embodiments of a system and a method to dynamically allocate memory to applications have been presented. For instance, an application interface executing on a processing device running in a computing system receives a request from an application running on the processing device for a predetermined capacity of memory. A kernel running on the processing device may allocate one or more consecutive heaps of memory to the application in response to the request. A total capacity of the heaps allocated is at least the predetermined capacity requested.