CUBA app running on OpenJ9

Are there people running a CUBA application with OpenJ9 JVM instead of Hotspot JVM ? Here is an interested comparison: https://www.eclipse.org/openj9/oj9_performance.html

Running my app in a Docker container, the total memory of the instance went from 583 MB in Hotspot to 334 MB in OpenJ9, which is 40% less memory. In the cloud, it reduces my bill since I can run more containers in the same VPS.

For anyone interested, I changed the build.gradle file to:

task createDockerFile(type:Dockerfile, dependsOn: buildUberJar){
    destFile=project.file('build/distributions/uberJar/Dockerfile')
    from 'adoptopenjdk/openjdk8-openj9'
    addFile("app.jar", "/usr/src/helium/app.jar")
    defaultCommand("java","-Dapp.home=/usr/src/helium/home","-jar","/usr/src/helium/app.jar")
}

So far, everything seems ok.

7 Likes

Update: when using OpenJ9, any table export to Excel generates a NullPointerException at sun.awt.FontConfiguration.getVersion

The solution is to install fontconfig to the Docker image, so my build.gradle now is:

task createDockerFile(type:Dockerfile, dependsOn: buildUberJar){
    destFile=project.file('build/distributions/uberJar/Dockerfile')
    from 'adoptopenjdk/openjdk8-openj9:slim'
    instruction 'RUN apt-get update && apt-get -y install fontconfig'
    addFile("app.jar", "/usr/src/helium/app.jar")
    defaultCommand("java","-Dapp.home=/usr/src/helium/home","-jar","/usr/src/helium/app.jar")
}
4 Likes