Bitmask Array Heap Management for Memory Fragmentation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing heap management schemes in network elements face challenges in minimizing memory overhead, reducing fragmentation, and optimizing search time for memory allocation and deallocation, leading to inefficiencies in data communication networks.
Innovation Solution
A bitmask array is implemented as a two-dimensional bit array, where each bit represents an allocated or free cell, and separate lists are maintained for each allocation size, along with linked lists to manage memory dynamically, reducing fragmentation and improving search efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If a traditional heap management data structure is used to track free and occupied cells, then the heap manager can maintain memory allocation information, but the memory overhead becomes huge with 8 to 28 bytes per memory allocation
Solution Approach 1:
The patent uses a bitmask array as a compact copy/representation of the heap memory state. Instead of storing detailed allocation information for each memory block, the system creates a bit-level copy of the entire heap status where each bit represents the allocation state of a memory cell. This reduces overhead from bytes per allocation to bits per cell, achieving dramatic space efficiency while maintaining full tracking capability.
Solution Approach 2:
The patent fundamentally changes the parameter representation from byte-level or word-level storage to bit-level storage. By representing memory cell states as individual bits rather than bytes or words, the system achieves an 8-fold or greater reduction in overhead. The bitmask array transforms the state representation parameter from conventional data types to bitwise operations, enabling efficient memory usage.
2Quantity of substance
If memory allocations are performed dynamically without organization, then allocation flexibility is maintained, but memory fragmentation increases significantly
Solution Approach 1:
The patent segments the heap memory into individual trackable cells and organizes them using a bitmask array where each bit corresponds to a specific cell. This segmentation allows the system to track and manage each cell independently, enabling efficient identification of contiguous free blocks. The segmentation approach facilitates better memory utilization by precisely tracking which cells are free and adjacent, thereby reducing fragmentation.
Solution Approach 2:
The bitmask array provides continuous feedback about the allocation state of each memory cell. When allocations or deallocations occur, the corresponding bits in the bitmask are updated, providing immediate feedback about available memory regions. This feedback mechanism enables the heap manager to make informed decisions about contiguous block allocation and effectively manage memory fragmentation by always knowing the current state of all cells.
3Loss of time
If a simple data structure is used for heap management, then implementation simplicity is achieved, but search time for available memory increases
Solution Approach 1:
The patent replaces mechanical linear search through allocation records with bitwise operations on the bitmask array. Instead of iterating through lists of allocated blocks to find free space, the system uses efficient bitwise AND, OR, and NOT operations to query the state of multiple cells simultaneously. This substitution of mechanical search with bitwise computation dramatically reduces search time while maintaining a relatively simple array-based data structure.
Solution Approach 2:
The patent transforms the one-dimensional sequential search problem into a two-dimensional bitmask array structure where cells are organized in rows and columns. This dimensional transformation enables parallel access to multiple cell states through bitwise operations, allowing the heap manager to evaluate entire rows or columns of memory cells in single operations rather than sequential iterations, thus reducing search time.
Data Source
AI summary
A bitmask array is implemented as a two dimensional bit array where each bit represents an allocated/free cell of the heap. Groups of bits of the bitmask array are assigned to implement commonly sized memory cell allocation requests. The heap manager keeps track of allocations by keeping separate lists of which groups are being used to implement commonly sized memory cell allocations requests by maintaining linked lists according to the number of cells allocated per request. Each list contains a list of the bit groups that have been used to provide allocations for particularly sized requests. By maintaining lists based on allocation size, the heap manager is able to cause new allocation requests to be matched up with previously retired allocations of the same size. Memory may be dynamically allocated between lists of differently sized memory requests.


