Hybrid Stack Heap Memory Allocation Strategy

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing memory allocation techniques face inefficiencies in managing stack and heap memory, particularly due to complex heap fragmentation and the need for manual or automatic memory management, which can lead to performance issues and memory leaks.

Innovation Solution

A method that determines the size of an item and allocates it to either stack or heap memory based on size thresholds, using hybrid allocation strategies like Simple Hybrid and B+ Tree Hybrid to optimize memory usage, reducing fragmentation and improving allocation/de-allocation speed by overloading memory functions and logging details for debugging.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If items are allocated to heap memory, then flexibility in allocation timing is improved, but memory fragmentation increases and allocation complexity increases

Engineering Contradiction:
Improveflexibility in allocation timingVSAvoidallocation complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent changes the parameter of allocation timing from flexible (heap) to fixed at compile time (stack), and changes the parameter of memory location from dynamic to static. This resolves the contradiction by accepting reduced flexibility in exchange for dramatically simplified allocation complexity, as stack allocation requires no runtime bookkeeping.

Inventive Principle:
Principle #35Parameter changes

2Adaptability or versatility

If many small blocks are allocated on heap, then dynamic allocation flexibility is improved, but heap fragmentation increases causing allocation failures

Engineering Contradiction:
Improvedynamic allocation flexibilityVSAvoidallocation success rate
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent performs preliminary action by allocating all small objects to the stack at compile time rather than allocating them dynamically on the heap during runtime. This prevents heap fragmentation from occurring in the first place, ensuring that heap memory remains available for large allocations and thus maintaining high allocation success rates.

Inventive Principle:
Principle #10Preliminary action

3Speed

If stack allocation is used, then allocation speed is improved, but flexibility in allocation timing is reduced

Engineering Contradiction:
Improveallocation speedVSAvoidflexibility in allocation timing
Core Design Contradiction:
SpeedVSAdaptability or versatility

Solution Approach 1:

The patent segments memory allocation into two distinct segments: stack allocation for small objects (prioritizing speed) and heap allocation for large objects (prioritizing flexibility). This segmentation allows the system to achieve fast allocation for the majority of small objects while maintaining the ability to allocate large blocks flexibly when needed.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS9460002B1Memory allocation
Publication Date: 2016.10.04 EMC IP HLDG CO LLC
  • US9460002B1 patent drawing
  • US9460002B1 patent drawing
  • US9460002B1 patent drawing

AI summary

There is disclosed a technique for use in memory allocation. In one embodiment, the technique comprises a method. The method comprises the step of determining the size of an item. The method also comprises the step of determining whether to allocate the item to stack or heap memory based on the size of the item.