Software Memory Layout Optimization via Inheritance Analysis

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Developers of software programs often create objects and data structures without considering memory alignment, leading to sub-optimal execution and increased memory consumption due to unnecessary padding, which reduces cache utilization and inefficiently uses memory.

Innovation Solution

A system that determines the inheritance hierarchy of software artifacts to generate optimized memory layouts for object instances, including field declarations and metadata, and provides visualizations to identify and suggest refactorings that reduce memory usage, allowing for improved memory management and cache efficiency.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If developers declare fields without considering alignment requirements, then the software program is easier to write and maintain, but memory consumption increases due to unnecessary padding

Engineering Contradiction:
Improveease of writing and maintaining softwareVSAvoidmemory consumption
Core Design Contradiction:
Ease of operationVSQuantity of substance

Solution Approach 1:

The system performs preliminary analysis of field declarations and automatically determines optimal ordering and padding placement before the software is executed. This preliminary action allows developers to write code without manually considering alignment requirements, while the system pre-calculates the optimal memory layout to minimize padding.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system enables the software to self-optimize its memory layout by automatically analyzing field declarations and generating optimized memory arrangements. The software serves itself by identifying padding opportunities and reorganizing fields without requiring developer intervention or manual memory management.

Inventive Principle:
Principle #25Self-service

2Speed

If padding is added to satisfy alignment requirements, then memory access efficiency improves, but memory consumption increases due to unused space

Engineering Contradiction:
Improvememory access efficiencyVSAvoidmemory consumption
Core Design Contradiction:
SpeedVSQuantity of substance

Solution Approach 1:

The system changes the parameters of field declarations by analyzing data types, sizes, and alignment requirements to determine optimal field ordering. By dynamically adjusting the arrangement parameters of fields in memory, the system achieves both efficient memory access and minimized padding requirements.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The system applies different padding strategies to different regions of the data structure based on local requirements. Instead of uniformly adding padding throughout, the system strategically places padding only where necessary to satisfy alignment requirements for specific fields, minimizing overall memory consumption while maintaining access efficiency.

Inventive Principle:
Principle #3Local quality

3Quantity of substance

If field ordering is optimized to reduce padding, then memory consumption decreases, but the complexity of memory layout management increases

Engineering Contradiction:
Improvememory consumptionVSAvoidmemory layout management complexity
Core Design Contradiction:
Quantity of substanceVSDevice complexity

Solution Approach 1:

The system introduces an intermediary analysis layer that automatically handles the complexity of memory layout optimization. This intermediary component analyzes field declarations, determines optimal ordering, and generates the optimized layout without requiring developers to directly manage the complex memory arrangement. The complexity is isolated in the automated analysis system rather than in the developer's workflow.

Inventive Principle:
Principle #24Intermediary (Mediator)

4Productivity

If memory layout is optimized for specific execution contexts, then performance improves, but the system becomes less adaptable to different execution contexts

Engineering Contradiction:
Improvesoftware performanceVSAvoidadaptability to execution contexts
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The system implements dynamic memory layout optimization by analyzing the actual execution context and adapting the memory layout accordingly. Rather than using a fixed optimized layout, the system dynamically determines the optimal arrangement based on runtime conditions, allowing the same optimization mechanism to adapt to different execution contexts while maintaining high performance.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS10275154B2Building memory layouts in software programs
Publication Date: 2019.04.30 ORACLE INT CORP
  • US10275154B2 patent drawing
  • US10275154B2 patent drawing
  • US10275154B2 patent drawing

AI summary

The disclosed embodiments provide a system that facilitates the execution of a software program. During operation, the system obtains a set of artifacts associated with executing a software program. Next, the system uses the set of artifacts to determine an inheritance hierarchy associated with an artifact from the set of artifacts. The system then uses the inheritance hierarchy and the set of artifacts to generate a memory layout of an object instance represented by the artifact, wherein the memory layout includes a set of fields associated with a set of levels of the inheritance hierarchy.