Skip to content

CARV-ICS-FORTH/flexheap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlexHeap: Dynamic I/O-Aware Heap Resizing for Managed Applications

Prerequisites and Compilation

System Requirements

  • OS: Ubuntu 20.04 or later (Debian-based)
  • Architecture: x86_64
  • Privileges: sudo access required for installing system packages

Dependencies

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

Setup

Run the setup script to install all prerequisites, compile the eBPF programs, and compile the FlexHeap JVM:

./setup.sh

The 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-9 and g++-9 as the required compiler toolchain
  • Installs eBPF dependencies (clang, llvm, libbpf-dev, libelf-dev, linux-tools-common)
  • Installs Python tools (intercept-build, compdb) via pip3

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 release mode for x86_64 using gcc-9
  • Uses OpenJDK 17 (/usr/lib/jvm/java-17-openjdk-amd64/) as the bootstrap JDK

Manual Compilation

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 compdb

2. 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 -

Unloading eBPF Programs

To unload the pinned eBPF objects from /sys/fs/bpf/:

./unload.sh

This removes the following pinned objects:

  • /sys/fs/bpf/sched_switch_link
  • /sys/fs/bpf/mutators
  • /sys/fs/bpf/enabled
  • /sys/fs/bpf/iowait

Troubleshooting

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 update

eBPF load fails: Ensure your kernel supports eBPF and that /sys/fs/bpf is mounted:

mount | grep bpf

JDK clone fails: Ensure your SSH key is configured for GitHub access:

Cleaning the Build

To clean the JDK build artifacts and unload and clean the eBPF programs, run:

./clean.sh

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors