Noncontiguous Array Representation for Memory Fragmentation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing memory allocation techniques for arrays are inefficient, leading to fragmentation issues and wasteful memory usage, especially when array sizes vary over time, and persistent data structures require inefficient copying to preserve versions.

Innovation Solution

A system that stores a composite array using a reference array and arraylets, where the length of the logical array is determined and represented in binary form to allocate contiguous memory locations, with arraylets allocated based on bit conditions, optimizing memory allocation and access.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If contiguous memory locations are allocated for arrays, then memory access efficiency is improved, but memory fragmentation occurs when array sizes vary over time

Engineering Contradiction:
Improvememory access efficiencyVSAvoidmemory fragmentation
Core Design Contradiction:
SpeedVSLoss of substance

Solution Approach 1:

The patent divides the array into multiple segments (arraylets) that can be allocated independently in non-contiguous memory locations. Each arraylet represents a portion of the logical array, allowing the system to allocate memory in smaller units that can be scattered throughout the heap without causing fragmentation. The reference array stores pointers to these arraylet segments, enabling efficient access while avoiding the fragmentation problem of large contiguous allocations.

Inventive Principle:
Principle #1Segmentation

2Adaptability or versatility

If maximum possible array size is allocated initially, then array growth capability is ensured, but memory waste occurs when array never grows to that size

Engineering Contradiction:
Improvearray growth capabilityVSAvoidmemory waste
Core Design Contradiction:
Adaptability or versatilityVSQuantity of substance

Solution Approach 1:

The patent implements dynamic array allocation where the array starts with a reference array of fixed size (based on bit representation) and grows by allocating arraylets as needed. The array's logical size can increase without reallocating the entire structure - new elements are placed in new arraylets that are linked through the reference array. This allows the array to adapt to actual usage patterns, allocating memory only when elements are added, thus avoiding waste from pre-allocating maximum size.

Inventive Principle:
Principle #15Dynamics

3Adaptability or versatility

If traditional dynamic allocation with doubling is used, then array growth is enabled, but CPU overhead from copying and initializing increases

Engineering Contradiction:
Improvearray growthVSAvoidCPU efficiency
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

Instead of copying entire arrays during growth operations, the patent segments the array into arraylets. When the array needs to grow, new arraylets are allocated and linked to the reference array without copying existing data. This eliminates the O(n) copying overhead of traditional doubling approaches, reducing CPU usage during array expansion operations.

Inventive Principle:
Principle #1Segmentation

4Stability of the object's composition

If persistent data structures use copying to preserve versions, then version preservation is achieved, but RAM usage and CPU usage increase significantly

Engineering Contradiction:
Improveversion preservationVSAvoidRAM usage
Core Design Contradiction:
Stability of the object's compositionVSQuantity of substance

Solution Approach 1:

The patent applies copying selectively at the arraylet level rather than the entire array level. When creating a persistent version of a data structure, only the arraylets that have been modified are copied, while unchanged arraylets are shared between versions. This dramatically reduces RAM usage compared to copying the entire array, while still preserving version history for modified portions.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS9189382B2Noncontiguous representation of an array
Publication Date: 2015.11.17 RED HAT INC
  • US9189382B2 patent drawing
  • US9189382B2 patent drawing
  • US9189382B2 patent drawing

AI summary

A system and method for storing a composite array including a reference array and one or more arraylets is provided. A set of contiguous memory locations for a reference array including one or more slots is allocated based on a quantity of bits in a binary representation of a logical array length. Each slot in the reference array corresponds to a position of a bit in the binary representation. For each bit corresponding to a slot that is determined to satisfy a condition, a set of contiguous memory locations is allocated for an arraylet, and a reference from the slot to the arraylet is provided. A largest arraylet having a greatest length of the allocated arraylets is identified, and a slice of adjacent data elements corresponding to a beginning of the logical array is placed into the largest arraylet.