Java agent that tracks the access to off-heap memory made by an application by
using Unsafe
class.
The goal of this project is being able to track usage of off-heap memory and detect potential memory leaks.
The detection is made via a Java agent implemented by using Byte Buddy library.
-
Download the agent jar file from the releases page or create it using the command below:
./gradlew jar
`
-
Launch the agent along with your Java application by adding these options to the Java command line:
-javaagent:$PWD/build/libs/unsafe-tracker-<VERSION>.jar \
-Xbootclasspath/a:$PWD/build/libs/unsafe-tracker-<VERSION>.jar \`
-
Compile the project using this command
./gradlew check shadowJar
-
Run it using this script:
bash run.sh
Thanks to Rafael Winterhalter for advising about the use of the Byte Buddy.