I am trying to run a Java program on GraalVM Community Edition 1.0 RC4 , the code works with last JDK 8 version. The code runs the same way with GraalVM but the same error message is printed in the console 100 times per second (I think every time that the garbage collector is needed/used) :
org.graalvm.compiler.debug.GraalError: <unknown> garbage collector is not supported by Graal
at org.graalvm.compiler.hotspot.HotSpotGraalRuntime.<init>(HotSpotGraalRuntime.java:205)
at org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory.createCompiler(HotSpotGraalCompilerFactory.java:145)
at org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory.createCompiler(HotSpotGraalCompilerFactory.java:123)
at org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory.createCompiler(HotSpotGraalCompilerFactory.java:47)
at jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.getCompiler(HotSpotJVMCIRuntime.java:360)
at jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.compileMethod(HotSpotJVMCIRuntime.java:448)
The program seems to be slowed down by the prints and/or by the possible absence of garbage collection and it never ends.
I made a test with a simple HelloWorld and the same error message keeps showing up. The program ends, since it's short enough, and it compiles.
I followed the tutorial on the official site with the GraalVM Community Edition. I found a similar error on Graal Github, but I can't figure out how to set the Garbage Collector, the command lines used seem to be Java 10 exclusive.
EDIT and Solution : I am using an Oracle VM VirtualBox on Ubuntu, it seems that the VM setting were too low. If you are encountering the same problem, increase your RAM and CPUs, it should solve it.
Copyright License:
Author:「Baptiste Merliot」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/51649497/garbage-collector-is-not-supported-by-graal