Skip to content

Hot Code Replace

Jinbo Wang edited this page May 9, 2020 · 6 revisions

Prerequisite

java.autobuild.enabled user setting is not disabled.

Limitation

The Hot Code Replace feature depends on the underlying JVM interface VirtualMachine#redefineClasses, and different JVM implementations will have different limitations. Using a typical oracle JDK as an example, below is the scenarios that Hot Code Replace cannot work:

  • Cannot change on the top call stack.
  • Cannot change on the call stack above the native methods.
  • Cannot change method names or introduce errors into running code.
  • Can change the method body. If succeeded, it will pop into the top most call stack that involving the changed types.

When you see these HCR failures, don't worry. It is safe to continue running the application, but you may notice discrepancies when debugging this application.

Clone this wiki locally