os::is_server_class_machine() uses VM_Version::logical_processors_per_package() before the value for threads for core is actually discovered.
So when gc is selected VM_Version::logical_processors_per_package() always returns 1.
This could cause wrong gc to be selected by ergonomics.
Code from thread.cpp:
jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
....
os::init_before_ergo();
jint ergo_result = Arguments::apply_ergo(); //<- os::is_server_class_machine() is called here during select_gc_ergonomically()
....
jint status = init_globals(); //<- thread for core is actually discovered here.
As far as I understand discovery of cpu threads for core value should be moved to os::init_before_ergo();
So when gc is selected VM_Version::logical_processors_per_package() always returns 1.
This could cause wrong gc to be selected by ergonomics.
Code from thread.cpp:
jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
....
os::init_before_ergo();
jint ergo_result = Arguments::apply_ergo(); //<- os::is_server_class_machine() is called here during select_gc_ergonomically()
....
jint status = init_globals(); //<- thread for core is actually discovered here.
As far as I understand discovery of cpu threads for core value should be moved to os::init_before_ergo();
- blocks
-
JDK-8148239 TestSelectDefaultGC.java incorrectly expects G1 on non-server class machines
-
- Resolved
-