No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Vladimir Dvorak 9bc42d28c5
Merge pull request #150 from spudmux/bugfix-#145/allow-choosing-of-hidden-files
2 months ago
agent/src/main/java Renaming org.dcevm -> com.github.dcevm 5 years ago
dcevm/src fix for proper incrementation of classRedefinedCount, till now we were updating value in old class Class file 1 year ago
gradle/wrapper Verify Mercurial is installed 3 years ago
hotspot/.hg/patches 8u201 and 8u202 patches, set 8u201 in properties 3 months ago
hotswap Preserving old Java 6 based patches 3 years ago
installer Merge pull request #150 from spudmux/bugfix-#145/allow-choosing-of-hidden-files 2 months ago
native Fixing native code compilation 5 years ago
.gitignore Do not clear f1 for now 3 years ago Update 4 months ago
build.cmd Fixing build.cmd 5 years ago
build.gradle Support for Java7u79 3 years ago set 8u202 in properties 3 months ago
gradlew Extracting DCEVM patch & code into separate project 5 years ago
gradlew.bat Extracting DCEVM patch & code into separate project 5 years ago
settings.gradle Set root project name explicitly 3 years ago

NEWS: Dcevm-11 on Trava OpenJDK

There is a new distribution channel for DCEVM-11 binaries on - TravaOpenjdk!


This project is a fork of original DCEVM project.

The purpose of the project is to maintain enhanced class redefinition functionality for OpenJDK HotSpot 7/8.


You can download binaries here.

Supported versions

hotspot/.hg/patches/ contains patches for all supported versions. Each patch is named by concatenating prefix full or light with the OpenJDK HotSpot tag. full patches support full redefenition capabilities (including removal of superclasses, for example). light patches are easier to maintain, but they only support limited functionality (generally, additions to class hierarchies are fine, removals are not).

HotSpot tag is the name of the tag in the corresponding HotSpot Mercurial repository (Java 8/Java 7).


General Requirements

You need the following software to build DCEVM:

  • Java 7 or later. If you intend to run tests, it should be one of the supported versions (see list of patches/)
  • C++ compiler toolchain (gcc). There is no strict version requirement except that it should be supported by HotSpot build scripts.
  • Mercurial with Mercurial Queues Extension enabled.

Mac OS X specific requirements

Currently the build is not compatible with Clang on Mac OS X, you need to install gcc 4.8 using the Homebrew:

brew tap homebrew/versions
brew install gcc48

Then set the following environmental properties:

export CC=/usr/local/bin/gcc-4.8
export CFLAGS=-fobjc-exceptions
export CXX=/usr/local/bin/g++-4.8
export SA_LDFLAGS=-fobjc-exceptions

Linux gcc8 specific prebuild steps

export CFLAGS="${CFLAGS//-O2/-O3} ${CPPFLAGS} -Wno-error=deprecated-declarations -Wno-error=stringop-overflow= -Wno-error=return-type -Wno-error=cpp -fno-lifetime-dse -fno-delete-null-pointer-checks"

Compiling DCEVM

  • Configure version you want in
  • Run ./gradlew patch to retrieve HotSpot sources and patch them.
  • Run ./gradlew compileFastdebug to build fastdebug version or ./gradlew compileProduct to build product version.
  • Compiled libraries are placed in hotspot/build/fastdebug or hotspot/build/product.

Installing DCEVM

  • Replace in the target JRE.
  • Run java -version, it should include Dynamic Code Evolution string.

Or you can install DCEVM using the gradle script:

  • Run ./gradlew installFastdebug -PtargetJre=$JAVA_HOME/jre or ./gradlew installProduct -PtargetJre=$JAVA_HOME/jre
  • DCEVM will be installed as “alternative” JVM. To use it, add -XXaltjvm=dcevm

Alternatively, on Debian and Ubuntu systems DCEVM can be installed with the openjdk-7-jre-dcevm package and invoked by adding the -dcevm command line parameter:

  • Run apt-get install openjdk-7-jre-dcevm
  • Run java -dcevm -version, it should include Dynamic Code Evolution string.

Testing DCEVM

  • Configure version you want in
  • Set JAVA_HOME to point to JDK you want to test against (should be compatible with the version you set in
  • Run ./gradlew patch to retrieve HotSpot sources and patch them.
  • Run ./gradlew test to run tests.
  • Tests reports will be in dcevm/build/reports/tests/index.html

To run tests from IDE, you need:

  • Run ./gradlew agent:build to build redefinition agent code.
  • Add JVM argument to use redefinition agent (-javaagent:agent/build/libs/agent.jar).
  • Add JVM argument to DCEVM VM if installed side-by-side (-XXaltjvm=dcevm).

Hotswap performance tweak (Experimental)

DCEVM executes deoptimization (purge of code cache) after any class redefinition. It leads to decrease JVM’s performance (after redefinition). This is especially problem on large scale projects with significant number of classes. Hotswap performance can be improved using an experimental option -XX:HotswapDeoptClassPath=. One or more packages can be specified in comma separated list as parameters. Packages must contain all classes that will be potentially modified (redefined). Classes outside of this list won’t be included in the deoptimization. Usually it is sufficient to specify application main or root package. If com.sun.proxy.Proxy is used in the application or by application’s framework, then this option should contain package com.sun.proxy as well. If HotswapDeoptClassPath option is not specified, then all classes will be deoptimized after redefinition. It is also recommended to clean all generated byte by reflection. Example:


Known issues