Memory Allocation System Using Heap Segmentation for Multithreaded Concurrency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional memory allocation techniques in multithreaded architectures face challenges with concurrent execution of memory allocation and deallocation routines, leading to inconsistent data structures and inefficiencies due to the need for locking mechanisms, which can result in idle processors and inefficient memory management.

Innovation Solution

A memory allocation system that uses a heap to track free tokens of memory and combines concurrent memory requests of the same type and size, employing a pennant data structure and funnel data structure to reduce contention and optimize memory access by designating a responsible thread to handle aggregate requests, thereby minimizing access to the heap.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If locking mechanisms are used to ensure consistent data structures during concurrent memory allocation and deallocation, then data consistency is improved, but processor idle time increases and productivity decreases

Engineering Contradiction:
Improvedata consistencyVSAvoidprocessor utilization
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the memory allocation system into multiple independent heaps, with each heap managed by a separate allocation routine. This segmentation allows multiple threads to access different heaps concurrently without requiring global locks, thereby maintaining data consistency while improving processor utilization. Each heap acts as an independent unit that can be accessed by multiple threads simultaneously, eliminating the need for centralized locking mechanisms.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces an intermediary layer (the heap data structure with its own internal consistency mechanisms) between the allocation routines and the underlying memory management system. This intermediary allows threads to perform allocation and deallocation operations without direct access to shared data structures, reducing contention and eliminating the need for locking while maintaining consistency through the intermediary's internal state management.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If conventional memory allocation techniques are used with locking mechanisms, then data structure consistency is maintained, but access time increases and speed decreases

Engineering Contradiction:
Improvedata structure consistencyVSAvoidmemory access speed
Core Design Contradiction:
ReliabilityVSSpeed

Solution Approach 1:

By dividing the memory system into multiple independent heaps, the patent enables parallel access to different segments of memory. Threads can access different heaps simultaneously without waiting for locks, dramatically improving memory access speed while maintaining consistency through each heap's independent management. This segmentation eliminates the serial bottleneck introduced by locking mechanisms.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Each heap is designed to be self-sufficient with its own internal allocation and deallocation routines that maintain consistency without external intervention. The heaps manage their own state and resources independently, allowing threads to perform operations quickly without waiting for lock acquisition or release, thereby improving access speed while preserving data structure consistency.

Inventive Principle:
Principle #25Self-service

3Reliability

If locking mechanisms are employed for concurrent memory access, then data consistency is ensured, but device complexity increases

Engineering Contradiction:
Improveconcurrent access consistencyVSAvoidsynchronization mechanism complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent reduces system complexity by segmenting memory into independent heaps that require no inter-heap synchronization. Each heap is a self-contained unit with simple, independent allocation and deallocation routines. This segmentation eliminates the need for complex global locking mechanisms and synchronization protocols, reducing device complexity while ensuring consistency within each heap through its own simple management structures.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The heap structure serves as an intermediary that encapsulates complexity within its own boundaries. Each heap manages its internal state and consistency without requiring external synchronization mechanisms. This intermediary approach isolates complexity to individual heaps rather than requiring system-wide complex synchronization, thereby reducing overall device complexity while maintaining concurrent access consistency.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS7624246B2Method and system for memory allocation in a multiprocessing environment
Publication Date: 2009.11.24 CRAY INC
  • US7624246B2 patent drawing
  • US7624246B2 patent drawing
  • US7624246B2 patent drawing

AI summary

A method and system for allocating and de-allocating memory for threads of an application is provided. An allocation system provides a heap for tracking free tokens of memory that are available for allocation to threads of an application. A heap tracks collections of free tokens of the fixed token size. The allocation system receives memory requests from threads that specify an allocation type of allocate or de-allocate. When multiple memory requests are pending concurrently from multiple threads, then the allocation system attempts to combine memory requests of the same type and of the same token size that are received from different threads. One of the threads is responsible for updating the heap to effect the two memory requests. The allocation system combines multiple memory requests so that the heap need only be accessed once to allocate or de-allocate multiple tokens.