Thread Memory Allocation Policy for Faster Heap Management

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing memory management methods suffer from low memory allocation speed and inefficient memory recollection due to frequent requests to the operating system or memory management system, leading to increased CPU usage and reduced efficiency.

Innovation Solution

A memory management method that determines a memory allocation policy for each target object based on its reference to another object, allowing for memory allocation in a target allocation buffer or heap memory, reducing the need for multiple requests and optimizing the allocation process.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If memory is allocated by requesting from the operating system or memory management system for each object, then memory allocation can be performed, but the allocation speed is slow and CPU usage increases

Engineering Contradiction:
Improvememory allocation speedVSAvoidtime for memory allocation requests
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The system pre-allocates a pool of memory blocks from the operating system in advance, storing them in a memory pool data structure. When memory allocation is needed, blocks are taken from this pre-allocated pool without requiring additional requests to the operating system, thereby improving allocation speed and reducing CPU overhead.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

A memory pool acts as an intermediary layer between the operating system and the application's memory allocation requests. The memory pool manages a collection of pre-allocated memory blocks, providing fast allocation to applications while the operating system is contacted only when the pool needs to be replenished.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Quantity of substance

If memory is allocated frequently from the operating system, then memory can be provided to objects, but the number of requests increases and efficiency decreases

Engineering Contradiction:
Improvememory availabilityVSAvoidmemory management efficiency
Core Design Contradiction:
Quantity of substanceVSProductivity

Solution Approach 1:

The system pre-allocates a pool of memory blocks from the operating system in advance, storing them in a memory pool data structure. When memory allocation is needed, blocks are taken from this pre-allocated pool without requiring additional requests to the operating system, thereby improving allocation speed and reducing CPU overhead.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

Multiple individual memory allocation requests are merged into a single bulk allocation request to the operating system. The memory pool consolidates many small allocation needs into one large allocation, reducing the total number of system calls and improving overall memory management efficiency.

Inventive Principle:
Principle #5Merging (Combining)

3Ease of operation

If memory allocation requests are made frequently, then objects can be allocated memory, but CPU usage of memory management code increases

Engineering Contradiction:
Improvememory allocation capabilityVSAvoidCPU usage for memory management
Core Design Contradiction:
Ease of operationVSUse of energy by moving object

Solution Approach 1:

The system pre-allocates a pool of memory blocks from the operating system in advance, storing them in a memory pool data structure. When memory allocation is needed, blocks are taken from this pre-allocated pool without requiring additional requests to the operating system, thereby improving allocation speed and reducing CPU overhead.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The memory pool manages its own internal allocation and deallocation operations without requiring intervention from the operating system or complex memory management code. Once the pool is initialized with memory blocks, it autonomously serves allocation requests from its internal buffer, reducing CPU usage of memory management code.

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS20250370801A1Memory management method and apparatus, medium, and electronic device
Publication Date: 2025.12.04 BEIJING VOLCANO ENGINE TECH CO LTD
  • US20250370801A1 patent drawing
  • US20250370801A1 patent drawing
  • US20250370801A1 patent drawing

AI summary

A memory management method, comprising: obtaining a target object to which memory is to be allocated in a target thread; determining, based on reference of the target object to another object, a memory allocation policy corresponding to the target object, the memory allocation policy comprising a first policy and a second policy, the first policy indicating to allocate, in an allocation buffer of heap memory, memory of a corresponding size to the target object, and the second policy indicating to allocate, in the heap memory, memory of a corresponding size to the target object; and allocating, based on the memory allocation policy corresponding to the target object, memory to the target object in a target allocation buffer corresponding to the target thread or in the heap memory, the target allocation buffer being configured to allocate memory to a plurality of objects in the target thread corresponding to the first policy.