In-Place Executable Relocation via Offset Pointer Adjustment

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In-place execution in Java Virtual Machines is hindered by execution speed issues due to immutable code and additional indirection caused by symbolic references, which are necessary for relocatable and portable executable files, making it unsuitable for memory-constrained devices like mobile phones.

Innovation Solution

The system loads an in-place executable file with internal pointers, determines the actual memory address, generates an offset if necessary, and adjusts these pointers to their correct locations using a relocation table, allowing the file to be relocated without performance overhead, and optionally writes back the adjusted file to storage.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Quantity of substance

If in-place execution is used with symbolic references for relocatability, then memory consumption is reduced, but execution speed deteriorates due to additional indirection and costly symbolic lookups

Engineering Contradiction:
Improvememory consumptionVSAvoidexecution speed
Core Design Contradiction:
Quantity of substanceVSSpeed

Solution Approach 1:

The patent applies preliminary action by performing symbolic reference resolution during the relocation process before execution begins. The relocation table is constructed in advance to map symbolic references to their actual memory locations, eliminating the need for costly runtime symbolic lookups. This pre-computation of reference resolution allows the executable to achieve both relocatability and fast execution.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces an intermediary structure (the relocation table) that mediates between the symbolic references in the in-place executable and the actual memory locations. This relocation table acts as a bridge, translating symbolic references into direct memory addresses during relocation, thereby eliminating the need for expensive symbolic lookups at runtime while maintaining relocatability.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Quantity of substance

If in-place execution with immutable code is used, then memory consumption is reduced, but runtime optimizations are limited due to code immutability

Engineering Contradiction:
Improvememory consumptionVSAvoidruntime optimization capability
Core Design Contradiction:
Quantity of substanceVSAdaptability or versatility

Solution Approach 1:

The patent applies dynamics by enabling the in-place executable to be relocated to different memory locations during execution. The relocation mechanism allows the code to dynamically adjust its memory address while maintaining the benefits of in-place execution. This dynamic relocation capability provides flexibility for runtime optimizations without compromising memory efficiency.

Inventive Principle:
Principle #15Dynamics

3Adaptability or versatility

If symbolic references are used for relocatability, then portability is improved, but performance deteriorates due to hashtable lookups and additional indirection

Engineering Contradiction:
ImproveportabilityVSAvoidexecution performance
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The patent applies preliminary action by pre-resolving symbolic references during the relocation process. The relocation table is constructed in advance to map all symbolic references to their actual memory locations, eliminating the need for costly runtime hashtable lookups. This pre-computation maintains portability while achieving fast execution.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces an intermediary structure (the relocation table) that mediates between the symbolic references in the portable executable and the actual memory locations. This relocation table acts as a bridge, translating symbolic references into direct memory addresses during relocation, thereby eliminating the need for expensive runtime symbolic lookups while maintaining portability.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS7603665B2Method and apparatus for loading relocatable in-place executable files in a virtual machine
Publication Date: 2009.10.13 ORACLE AMERICAN INC
  • US7603665B2 patent drawing
  • US7603665B2 patent drawing
  • US7603665B2 patent drawing

AI summary

One embodiment of the present invention provides a system that facilitates loading of an in-place executable file into a virtual machine. The system operates by loading the in-place executable file into the virtual machine, where the in-place executable file contains internal pointers that point to memory locations within the in-place executable file, and a target memory address that specifies a target location in memory where the in-place executable file is configured to be loaded. The system then determines an actual memory address at which the in-place executable file is actually loaded. If the actual memory address and the target memory address are different, the system generates an offset value, which is the difference between the actual memory address and the target memory address. Finally, the system adjusts each internal pointer within the in-place executable file by the offset value so that the internal pointers point to intended locations inside the in-place executable file.