cloudcaptainsh / cloudcaptain

Issue Tracker for CloudCaptain
13 stars 3 forks source link

Failed JVM Startup JDK17 (with Z GC) #273

Open knocknarea opened 1 year ago

knocknarea commented 1 year ago

Hello @axelfontaine

I am seeing this when trying to start our application using upgrade to JDK17 and hopefully using the Z Garbage Collector

17:14:19.999 ERROR: i-*****26d8 => 2022-10-10 17:14:07.584 /launch.sh: line 30: can't create /jre/lib/management/jmxremote.access: nonexistent directory
17:14:19.999 i-*****26d8 => 2022-10-10 17:14:07.585 [0.004s][error][gc] **Failed to find an accessible tmpfs filesystem**
17:14:19.999 i-*****26d8 => 2022-10-10 17:14:07.585 [0.004s][error][gc] Use -XX:AllocateHeapAt to specify the path to a tmpfs filesystem
17:14:19.999 ERROR: i-*****26d8 => 2022-10-10 17:14:07.586 Error: Could not create the Java Virtual Machine.
17:14:19.999 ERROR: i-*****26d8 => 2022-10-10 17:14:07.586 Error: A fatal exception has occurred. Program will exit.

It looks like the AMI produced by cloudcaptain does not have any tmpfs configured for the ZGC to use.

According to this fix, JDK now automatically looks in: /dev/shm and /run/shm (in that order) for tmpfs

JVM Args are:

-XX:+UseZGC -XX:+UseDynamicNumberOfGCThreads 

JDK version is set as:

components.openjdk=17.0.0.4

So I suppose the question, is there a tmpfs created? and if so, what path is is created on so that I may configure -XX:AllocateHeapAt to point at it. Any help on this would be greatly appreciated as I am on the clock on this one.

axelfontaine commented 1 year ago

@knocknarea The rootfs is actually a tmpfs. However I am not sure this will work. Let me think a bit more about this. (As a workaround you can of course switch back to another GC like G1)

knocknarea commented 1 year ago

Thank you @axelfontaine for looking into it. I can keep going with the G1 for now, but ideally I'd like to leverage the latest and greatest