Fast On-Chip RAM Code Execution Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Memory-constrained computing devices with fast on-chip RAM face challenges in executing code efficiently due to limited cache memory and fragmentation issues, leading to slow execution times, especially in dynamic adaptive compilers.

Innovation Solution

A system that copies compiled methods from the object heap to the fast on-chip RAM, updates execution pointers, and manages memory during garbage-collection operations to optimize code execution, while also considering size and ranking thresholds for method caching.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If code is copied to fast RAM for faster execution, then code execution speed is improved, but fast RAM fills up quickly and causes fragmentation

Engineering Contradiction:
Improvecode execution speedVSAvoidavailable fast RAM space
Core Design Contradiction:
SpeedVSQuantity of substance

Solution Approach 1:

The patent merges the code cache and object heap into a single memory space. Compiled methods are stored in the object heap rather than in a separate code cache, allowing the JVM to allocate memory dynamically without the constraints of a fixed-size code cache. This eliminates the problem of fast RAM filling up quickly while maintaining the ability to execute code from the heap.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The object heap serves multiple functions: it stores both object data and compiled methods. This multi-functional approach allows the same memory space to be used for both data storage and code execution, maximizing the utilization of limited memory resources and preventing fragmentation caused by separate code cache allocation.

Inventive Principle:
Principle #6Universality (Multi-functionality)

2Speed

If a separate code cache is used, then code execution is faster, but device complexity increases

Engineering Contradiction:
Improvecode execution speedVSAvoidmemory management complexity
Core Design Contradiction:
SpeedVSDevice complexity

Solution Approach 1:

The patent eliminates the separate code cache structure by combining code storage with the object heap. This merger simplifies the memory architecture by removing the need for separate code cache management, allocation strategies, and eviction policies, thereby reducing device complexity while maintaining execution speed through direct heap access.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The object heap is designed to serve dual purposes: storing object instances and storing compiled methods. This universal memory structure simplifies the overall system by eliminating the need for specialized code cache hardware or software structures, reducing device complexity while preserving fast execution capabilities.

Inventive Principle:
Principle #6Universality (Multi-functionality)

3Loss of time

If more code is cached in fast RAM, then execution time decreases, but fragmentation issues arise quickly

Engineering Contradiction:
Improveexecution timeVSAvoidmemory fragmentation
Core Design Contradiction:
Loss of timeVSStability of the object's composition

Solution Approach 1:

By merging code and data into the same object heap, the patent enables contiguous memory allocation. The garbage collector can compact the heap to eliminate fragmentation, ensuring that sufficient contiguous space is always available for copying compiled methods, thus reducing execution time without suffering from fragmentation issues.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent employs dynamic memory allocation within the object heap, where the allocation of compiled methods is flexible and adaptive. The garbage collector dynamically manages memory space, compacting the heap as needed to prevent fragmentation and ensure that sufficient contiguous space is available for code copying, thereby maintaining stable memory composition even as code is cached.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS7539822B1Method and apparatus for facilitating faster execution of code on a memory-constrained computing device
Publication Date: 2009.05.26 ORACLE AMERICAN INC
  • US7539822B1 patent drawing
  • US7539822B1 patent drawing
  • US7539822B1 patent drawing

AI summary

One embodiment of the present invention provides a system that facilitates faster execution of code on a memory-constrained computing device that has fast on-chip RAM, wherein the fast on-chip RAM is located on a processor chip, but is not cache memory. The system operates by copying a compiled method from an object heap to the fast on-chip RAM on the memory-constrained computing device. Additionally, the system updates an execution pointer to point to the compiled method in the fast on-chip RAM, wherein the execution pointer can also point to a compiled method in the object heap or an interpreted method in the object heap.