- OS: Ubuntu 20.04 or later (Debian-based)
- Architecture: x86_64
- Privileges: sudo access required for installing system packages
The setup script will automatically install the following dependencies:
| Category | Package(s) |
|---|---|
| JDK | openjdk-21-jdk |
| Compiler | gcc-9, g++-9 |
| eBPF | clang, llvm, make, libbpf-dev, libelf-dev, linux-tools-common |
| Python tools | pip3, intercept-build (scan-build), compdb |
Run the setup script to install all prerequisites, compile the eBPF programs, and compile the FlexHeap JVM:
./setup.shThe setup script performs the following steps automatically:
Step 1 — Install prerequisites
- Installs OpenJDK 21 (
openjdk-21-jdk) as the bootstrap JDK for compilation - Installs
gcc-9andg++-9as the required compiler toolchain - Installs eBPF dependencies (
clang,llvm,libbpf-dev,libelf-dev,linux-tools-common) - Installs Python tools (
intercept-build,compdb) viapip3
Step 2 — Compile eBPF programs
- Builds and loads the eBPF profiler programs located in
./ebpf/ - The eBPF programs are pinned under
/sys/fs/bpf/
Step 3 — Compile the FlexHeap JVM
- Clones the FlexHeap JDK repository from GitHub (branch
flexheap_jdk21) - Compiles the JVM in
releasemode forx86_64usinggcc-9 - Uses OpenJDK 17 (
/usr/lib/jvm/java-17-openjdk-amd64/) as the bootstrap JDK
If you prefer to run each step individually instead of using setup.sh:
1. Install prerequisites:
# JDK 21
sudo apt-get install -y openjdk-21-jdk
# GCC 9
sudo apt-get install -y gcc-9 g++-9
# eBPF dependencies
sudo apt-get install -y clang llvm make libbpf-dev libelf-dev linux-tools-common
# Python tools
pip3 install scan-build compdb2. Compile and load eBPF programs:
cd ebpf
make clean
make
make load
cd -3. Compile the FlexHeap JVM:
git clone [email protected]:jackkolokasis/jdk.git
cd jdk
git checkout flexheap_jdk21
./compile.sh -t x86_64 -b /usr/lib/jvm/java-17-openjdk-amd64/ -g 9 -i "release"
cd -To unload the pinned eBPF objects from /sys/fs/bpf/:
./unload.shThis removes the following pinned objects:
/sys/fs/bpf/sched_switch_link/sys/fs/bpf/mutators/sys/fs/bpf/enabled/sys/fs/bpf/iowait
No sudo access: If the setup script fails with a sudo error, ask your system administrator to install the required packages listed in the Dependencies table above.
gcc-9 not found: On Ubuntu 22.04+, gcc-9 may not be available in the
default apt repositories. Add the toolchain PPA first:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get updateeBPF load fails: Ensure your kernel supports eBPF and that
/sys/fs/bpf is mounted:
mount | grep bpfJDK clone fails: Ensure your SSH key is configured for GitHub access:
ssh -T [email protected]To clean the JDK build artifacts and unload and clean the eBPF programs, run:
./clean.sh