Memory Block Segmentation for Binary Buddy Allocation Fragmentation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Binary Buddy allocation techniques suffer from internal fragmentation due to their inability to allocate and deallocate blocks of sizes that are not powers of two, leading to wasted storage space that cannot be reused for future requests.

Innovation Solution

The proposed process involves allocating and deallocating memory by retrieving blocks of sufficient size, releasing power of 2 units until the exact requested size is achieved, and merging adjacent free blocks to eliminate fragmentation, while maintaining the desirable properties of Binary Buddy allocation such as on-the-fly coalescing and alignment.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If Binary Buddy allocation allocates blocks whose size is a power of two, then allocation and deallocation can be performed efficiently in time proportional to log N, but internal fragmentation occurs and storage space is wasted

Engineering Contradiction:
Improveallocation and deallocation efficiencyVSAvoidinternal fragmentation
Core Design Contradiction:
ProductivityVSLoss of substance

Solution Approach 1:

The patent segments a power-of-two sized block into multiple smaller blocks when allocating memory. Instead of allocating the entire power-of-two block to a single request, the system divides it into smaller allocable blocks, allowing future allocations of various sizes without wasting the entire block. This segmentation resolves the contradiction by enabling both efficient power-of-two-based management and reduced internal fragmentation.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements dynamic block management where blocks can be split into smaller units and merged back together. The allocation structure dynamically adjusts block sizes based on实际需求, transforming the static power-of-two block structure into a flexible system that can adapt to different allocation requests while maintaining the underlying power-of-two organization for efficient management.

Inventive Principle:
Principle #15Dynamics

2Device complexity

If Binary Buddy allocation uses fixed power of two block sizes, then the data structure remains simple requiring only log log N + 1 bits per block, but the system cannot allocate arbitrary request sizes without waste

Engineering Contradiction:
Improvedata structure complexityVSAvoidrequest size flexibility
Core Design Contradiction:
Device complexityVSAdaptability or versatility

Solution Approach 1:

The patent employs a nested structure where power-of-two blocks contain smaller allocable blocks within them. The allocation system maintains the outer power-of-two block structure for efficient management while nesting inner blocks of various sizes for flexible allocation. This nested approach allows the system to handle arbitrary request sizes without increasing the fundamental data structure complexity.

Inventive Principle:
Principle #7Nested doll (Nesting)

Solution Approach 2:

The patent adds a second dimension to the block structure by introducing allocable blocks within power-of-two blocks. Instead of a single-level structure, the system creates a hierarchical dimension where outer blocks provide the power-of-two organization and inner blocks provide size flexibility, effectively solving the contradiction between simplicity and adaptability.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

3Productivity

If Binary Buddy allocation coalesces released blocks on the fly, then free blocks remain fully coalesced without additional processing, but blocks can only be coalesced if they are adjacent and of the same size

Engineering Contradiction:
Improvecoalescing efficiencyVSAvoidblock merging flexibility
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The patent segments blocks into power-of-two units that can be independently managed and coalesced. By dividing blocks into standardized power-of-two segments, the system enables flexible merging of adjacent segments of the same size while maintaining the ability to handle arbitrary request sizes. This segmentation allows coalescing to work efficiently with the segmented structure.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent changes the size parameter of blocks to be powers of two, which enables efficient coalescing operations. By standardizing block sizes to power-of-two values, the system can efficiently identify and merge adjacent blocks of the same size while still providing flexibility for arbitrary allocations through the segmentation and nesting mechanisms.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS10606741B2Process for buddy allocation
Publication Date: 2020.03.31 AIR TECH HLDG LTD
  • US10606741B2 patent drawing
  • US10606741B2 patent drawing
  • US10606741B2 patent drawing

AI summary

A process improves upon the binary buddy allocation approach by salvaging memory units that are typically unused during the binary buddy technique. A free power of 2 size block of memory, retrieved in response to an allocation request, is decomposed by releasing units in power of 2 sizes until the requested size is reached. Released units are made available for subsequent allocation requests. The deallocation of a previously allocated block causes the decomposition of the block into power of 2 size sub-blocks. These sub-blocks may be merged with adjacent free blocks using the binary buddy approach now that units in power of 2 are available. The process keeps free blocks maximally coalesced, so that additional steps of defragmentation or merging are not required. A maximum size value restriction may be attached to some blocks of memory which remains preserved during any of the allocation or deallocation processes.