Packed Data Objects for Java Heap Memory Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Java programming language's limitation in handling nested structured value types, where object reference fields require additional heap memory and new object headers, leading to increased heap fragmentation and inefficiencies in memory allocation and garbage collection.
Innovation Solution
An enhanced compiler and runtime system that creates a packed data object by inlining all fields, including object reference fields, and storing the packed data object header and data together in the memory heap, reducing memory footprint and fragmentation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If object reference fields are allocated as references to another allocated instance object, then object composition and polymorphism are maintained, but heap memory usage increases and heap fragmentation worsens
Solution Approach 1:
The patent merges the object header and data fields into a single contiguous memory allocation. Instead of allocating separate memory for the object header and then for the data fields (which causes fragmentation), the system allocates one unified block that contains both the header with type information and all the data fields inline, eliminating the need for separate reference allocations and reducing overall heap memory usage.
Solution Approach 2:
The patent segments the object into two distinct parts: a header containing type information and a data section containing the actual fields. This segmentation allows the system to maintain type information for polymorphism while storing all data fields inline, achieving both memory efficiency and object composition capabilities.
2Adaptability or versatility
If object reference fields are allocated as references to another allocatedinstance object, then object composition and polymorphism are maintained, but heap fragmentation increases
Solution Approach 1:
The patent merges the object header and data fields into a single contiguous memory allocation. Instead of allocating separate memory for the object header and then for the data fields (which causes fragmentation), the system allocates one unified block that contains both the header with type information and all the data fields inline, eliminating the need for separate reference allocations and reducing overall heap memory usage.
3Quantity of substance
If primitive fields are allocated inline with the object, then memory efficiency is improved, but Java's limitation in handling nested structured value types prevents full optimization
Solution Approach 1:
The patent creates a universal object representation that works for all Java objects, including those with nested structured value types. The packed object format can represent both simple primitive fields and complex nested object references using the same unified structure, allowing the system to optimize memory efficiency across all object types without sacrificing the ability to handle nested structures.
Data Source
AI summary
A computer-implemented process for creating a packed data object, the computer-implemented process comprising providing instrumentation to an enhanced runtime by an enhanced compiler for a computer executable program portion, detecting a special class in the computer executable program portion by the enhanced runtime, creating an internal representation of a packed data object header using the instrumentation, calculating a size of elements for a packed data object associated with the computer executable program portion, determining a type of packed data object using information in the packed data object header, and responsive to a determination that the type of packed data object is an on-heap packed data object, storing the packed data object header and associated packed data object data together for the packed data object in a memory heap.


