JVM Class Instrumentation via Analysis Fields

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing techniques for instrumenting Java Virtual Machine (JVM) environments face challenges in efficiently instrumenting bootstrap classes, as they are typically loaded before instrumentation can occur, leading to issues with ease of use and incomplete instrumentation of classes.

Innovation Solution

Declaring analysis fields in selected classes that extend bootstrap classes during the class loading process, allowing for the monitoring and instrumentation of fields without modifying the bootstrap classes themselves, thereby enabling effective dynamic analysis.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If bootstrap classes are instrumented before JVM startup, then instrumentation completeness is improved, but system complexity and ease of use deteriorate

Engineering Contradiction:
Improveinstrumentation completenessVSAvoidsystem complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent applies preliminary action by declaring analysis fields in selected classes during the class loading process, before the classes are fully initialized and used. This allows instrumentation to occur at an early stage (during loading) rather than requiring pre-instrumentation of bootstrap classes before JVM startup, thereby achieving complete instrumentation while avoiding the complexity of modifying the bootstrap class loading mechanism.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If bootstrap classes are modified for instrumentation, then instrumentation completeness is improved, but ease of operation worsens

Engineering Contradiction:
Improveinstrumentation completenessVSAvoidease of use
Core Design Contradiction:
ReliabilityVSEase of operation

Solution Approach 1:

The patent uses an intermediary approach by declaring analysis fields in selected classes that extend bootstrap classes, rather than directly modifying the bootstrap classes themselves. This intermediary mechanism allows instrumentation of the entire class hierarchy (including bootstrap classes) while maintaining the simplicity of the bootstrap class loading process and avoiding direct modification of core JVM components.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Loss of time

If classes are instrumented during loading, then instrumentation timing is improved, but measurement precision of bootstrap class fields worsens

Engineering Contradiction:
Improveinstrumentation timingVSAvoidbootstrap class field monitoring
Core Design Contradiction:
Loss of timeVSMeasurement precision

Solution Approach 1:

The patent applies segmentation by separating the instrumentation approach into two parts: (1) declaring analysis fields in selected classes during loading for timely instrumentation, and (2) using inheritance relationships to indirectly monitor bootstrap class fields. This segmentation allows both timely instrumentation and precise monitoring of bootstrap class fields without requiring direct modification of bootstrap classes.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS8863093B1Load-time instrumentation of virtual machine program code
Publication Date: 2014.10.14 BLACK DUCK SOFTWARE INC
  • US8863093B1 patent drawing
  • US8863093B1 patent drawing
  • US8863093B1 patent drawing

AI summary

A method to instrument program code for a virtual machine that comprises, in the course of loading a class to a virtual machine, adding code to the class to declare a field that corresponds to a field declared in a first bootstrap class.