-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
native-image throws exception: <unknown> garbage collector is not supported by Graal #545
Comments
Can you please paste the output of |
sure, here is the full output:
|
One more request for output: |
here we go:
|
hmmm... the output looked a bit strange. i adjusted grep like this:
|
This is what I get for CE 1.0.0-rc3 on my Linux VM:
As you can see, the ParallelGC is selected. Maybe you can look at the complete output of |
It's interesting... looks like in my case none of the GC algorithms is selected. Do you know how the GC selection is done. maybe it is something in my environment that prevents any GC alg. from being selected? Also, what does
|
In my previous investigation I also tried to find a way to explicitly set the GC alg. But I could not find a way to do it in the docs. How i know that it should be prefixed with
But I still wonder why none of the GC alg. is selected by default and I need to specify it explicitly? |
The |
🤔 maybe |
I wonder whether this is related: https://bugs.openjdk.java.net/browse/JDK-8149185 |
Yes, that looks likely. However, it seems weird that you have even start a VM with no GC selected. |
At this point I probably should mention that I currently testing it as a docker container and the host OS is Windows 8, docker runs via docker-machine. My setup is currently a bit convoluted :) It is possible that docker machine has very little resources and runs as a guest (although I gave it 3 GB memory). On the other hand, rc1 was working fine with this setup. I can also test it tomorrow on my macbook. |
I think I just verified it. I had the the default number of CPUs for my docker-machine = 1. After giving it more CPUs (3) everything works fine and I see automatically selected GC:
|
Here's what I get from graalvm-ee-1.0.0-rc3-dev
which matches what Doug sees on his Linux machine. Does your docker container have more than one processor? If not, it will not qualify as a "server-class" machine. I can simulate that by passing an additional flag
which looks like the original problem. If GraalVM does not support the serial collector, but finds itself on a non-server-class machine os::is_server_class_machine(), then it apparently does not get a collector at all. Not a nice error message, though. The |
👍 thanks a lot, everybody! I think this is it. The root cause was the number of CPUs: if machine has only 1 CPU, then GC is not selected automatically. I'm not sure how wide-spread this situation might be, but maybe it would make sense to either improve the error message, make a note about this in the docs or add some meaningful default for this scenario (like mentioned |
Maybe a workaround for @dougxc is to set |
The primary question for me is what GC is actually used if none of the GC command line arguments are set? Is it serial GC? Or no GC?! I can't find any API in the VM to answer the question "what GC are you using?" other than querying the flags. |
If I understand |
I agree with your analysis of Universe::initialize_heap: that the default If it is any consolation, I see
That is, on an explicitly non-server-class machine, with no GC requested on the command line, none of the command line GC flags is set. I find it surprising that the choice of the default collector is not represented in the setting of the flags, the way it is on a server-class machine. But
I do have a collector, and I can tell that it is the one I would get with |
Hi, I am getting the exact same error message at least 20 times per second while running my project :
I installed GraalVM Community Edition 1.0 RC4 while following the getting started guide. I am running it on an Oracle VM VirtualBox with Ubuntu 18.04.1 LTS. The project runs fine on a classic jdk 8 on the same machine, but with Graal it becomes extremely slow (due to the error messages flow and/or GC issues I would guess). I gave 8GB of RAM to the VirtualBox VM since it may have been an issue as mentioned. |
@BMerliot Have you also increased number of CPUs in the VirtualBox for your image? This helped in my case. |
I increased from 1 to 4 CPUs and it worked, thanks a lot! |
This was fixed in 0cae23f, and should be in GraalVM Community Edition 1.0 RC5. If you do not have a "server class" (virtual) machine you will now get the -XX:+UseSerialGC collector. |
Thank you very much! I think the issue is now resolved. |
GraalVM version: CE 1.0.0-rc3
Even when I try to list expert options with:
I get following exception:
Steps to reproduce
I'm using following docker image:
Which was created with this Dockerfile (standard GraalVM distribution, I don't compile from source).
You can use following command to debug inside the container:
The GraalVM is installed in
/usr/lib/graalvm/
.The text was updated successfully, but these errors were encountered: