Compacting Pseudo Linear Byte Arrays for Database Driver Memory Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In database environments, caching result sets in byte arrays leads to memory pressure on client database drivers and frequent resource-intensive calculations to determine data size, reducing the ability to cache additional data and increasing processor usage.

Innovation Solution

A system and method for compacting pseudo linear dynamic byte arrays by creating a static byte array when the dynamic array is underfilled, calculating the data size, and storing it as metadata, allowing for efficient access and reducing the need for frequent recalculations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If result sets are cached in dynamic byte arrays, then data can be stored and retrieved, but memory pressure increases and the ability to cache additional data is reduced

Engineering Contradiction:
Improvedata caching capabilityVSAvoidmemory usage
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent changes the structure parameter of the byte array from dynamic to static allocation. By pre-allocating a fixed size buffer and tracking the actual data size separately, the system transforms the memory consumption pattern from unbounded growth to controlled allocation, thereby reducing memory pressure while maintaining caching functionality.

Inventive Principle:
Principle #35Parameter changes

2Measurement precision

If the size of the byte array is constantly calculated for status reporting and cache management, then accurate cache size information is available, but processor usage increases and performance decreases

Engineering Contradiction:
Improvecache size accuracyVSAvoidprocessor efficiency
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent performs the size calculation action in advance by maintaining a running counter of the actual data size as data is written to the byte array. This preliminary tracking eliminates the need for repeated size calculations during cache management operations, significantly reducing processor usage while maintaining accurate size information.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system makes the byte array structure self-aware of its own size by maintaining an internal counter that automatically tracks the amount of data stored. This self-service mechanism provides accurate size information without requiring external calculation or intervention, improving both measurement precision and processor efficiency.

Inventive Principle:
Principle #25Self-service

3Adaptability or versatility

If a dynamic byte array is used to store result sets, then flexible data storage is achieved, but frequent size calculations are required which are resource-expensive

Engineering Contradiction:
Improvedata storage flexibilityVSAvoidcomputational resource consumption
Core Design Contradiction:
Adaptability or versatilityVSUse of energy by moving object

Solution Approach 1:

The patent segments the byte array into two functional parts: a pre-allocated static buffer for data storage and a separate size counter for tracking. This segmentation allows the system to maintain the flexibility of dynamic data storage while eliminating the computational overhead of frequent size calculations, as the size is continuously tracked rather than recalculated.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS9880938B2System and method for compacting pseudo linear byte array
Publication Date: 2018.01.30 ORACLE INT CORP
  • US9880938B2 patent drawing
  • US9880938B2 patent drawing
  • US9880938B2 patent drawing

AI summary

In accordance with an embodiment, described herein is a system and method for compacting a pseudo linear byte array, for use with supporting access to a database. A database driver (e.g., a Java Database Connectivity (JDBC) driver) provides access by software application clients to a database. When a result set (e.g., ResultSet) is returned for storage in a dynamic byte array (DBA), in response to a database query (e.g., a SELECT), the database driver determines if the DBA is underfilled and, if so, calculates the data size of the DBA, creates a static byte array (SBA) in a cache at the client, compacts the returned data into the SBA, and stores the data size as part of the metadata associated with the cache. In accordance with an embodiment, the DBA and the SBA can use a same interface for access by client applications.