Dynamic Memory Allocation for Graph Database Thread Bottlenecks

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Graph databases face performance issues due to increasing data storage and sporadic traffic patterns, leading to resource-intensive operations that are difficult to provision efficiently.

Innovation Solution

A memory allocator that dynamically allocates memory by setting a maximum managed memory size (MAX_MEM) for individual threads or requests, allowing for flexible memory usage and temporary blocking of threads until more memory becomes available.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If memory is allocated to process all threads concurrently, then processing capacity is improved, but memory availability for other operations deteriorates

Engineering Contradiction:
Improvethread processing capacityVSAvoidavailable memory
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The system dynamically adjusts memory allocation based on real-time conditions. When memory pressure is detected, the allocator temporarily blocks threads instead of immediately denying allocation, allowing memory to be freed by other operations and then re-allocated to blocked threads when resources become available. This dynamic approach optimizes both memory utilization and processing capacity.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The memory allocator changes the state parameter of threads from 'running' to 'blocked' when memory allocation cannot be immediately satisfied. This parameter change allows the system to manage memory resources more effectively by pausing non-critical operations until resources are available, rather than permanently rejecting them or allocating memory indefinitely.

Inventive Principle:
Principle #35Parameter changes

2Reliability

If resources are provisioned to handle high bursts of traffic, then traffic handling capability is improved, but resource utilization efficiency deteriorates

Engineering Contradiction:
Improvetraffic handling capabilityVSAvoidresource utilization efficiency
Core Design Contradiction:
ReliabilityVSLoss of energy

Solution Approach 1:

The system employs periodic memory allocation checks and thread re-attempts. Instead of maintaining constant resource provisioning, the allocator periodically evaluates memory availability and re-allocates to blocked threads when resources become available. This periodic re-evaluation allows the system to handle traffic bursts effectively while minimizing resource consumption during low-activity periods.

Inventive Principle:
Principle #19Periodic action

Solution Approach 2:

Blocked threads are automatically re-attempted when memory becomes available, without requiring external intervention or permanent resource reservation. The system self-manages the re-allocation process by monitoring memory conditions and automatically restarting blocked operations when resources are freed, improving both reliability and efficiency.

Inventive Principle:
Principle #25Self-service

3Ease of operation

If threads are blocked when memory is unavailable, then memory allocation fairness is improved, but processing time deteriorates

Engineering Contradiction:
Improvememory allocation fairnessVSAvoidthread processing time
Core Design Contradiction:
Ease of operationVSLoss of time

Solution Approach 1:

The system performs preliminary memory availability checks before committing threads to execution. When memory is insufficient, threads are blocked in advance rather than allowing them to consume partial resources or fail later. This preliminary blocking ensures fair memory distribution while minimizing overall processing time by preventing wasted execution attempts.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The memory allocator implements a feedback mechanism where blocked threads are monitored and re-attempted when memory conditions improve. The system continuously feedbacks on memory availability to the thread pool, allowing blocked threads to be restarted when resources become available, thus balancing fairness with processing efficiency.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS12321389B1Dynamic bounded memory allocation
Publication Date: 2025.06.03 AMAZON TECH INC
  • US12321389B1 patent drawing
  • US12321389B1 patent drawing
  • US12321389B1 patent drawing

AI summary

Systems and methods are described for dynamically allocating memory for responding to requests. In some aspects, a thread may be obtained, where the thread includes a request to use a portion of system memory to perform a query of a database, such as a graph database. The system may determine that the portion of memory is greater than available memory of a maximum managed memory size of the system, and may block the thread until additional memory becomes available. The maximum managed memory size may be configurable, and may be less than a total memory of the system. The system may then determine, based at least in part on a change in the available system memory, that the available system memory is equal to or greater than the portion of memory to satisfy the request, and cause the system to process the thread to provide a response to the query.