Skip to content

sunwu51/JVMByteSwapTool

Repository files navigation

JVM ByteSwap Tool

logo

actions

A tool that can hot swap the class byte code while jvm is running. Very suitable for SpringBoot framework.

Based on the jvm instrumentation tech, javassist lib, JVMTI.

Usage

Download the zip file from the release page.

Make sure you have a JDK >= 1.8 and should better JDK <= 11, because javassist may not support new language feature util now.

$ unzip swapper-<latest-version>.zip

$ java -jar swapper.jar

// All of the java processes will be listed in following
// Choose the pid you want to attach
// Then a web ui will be served at http://localhost:8000

Visit this url http://localhost:8000 then you will get the following Web UI.

image

Now you can enjoy the functionalities of swapper tool.

For example, Watch some methods

image

Trigger this method, and then the params and return value and execution time cost will be printed.

image

It's Watch one of the functions provided by swapper tool.

Get more functions and details from the wiki.