equal
deleted
inserted
replaced
69 // enough, but we also do not want to steal too much CPU from the concurrently running |
69 // enough, but we also do not want to steal too much CPU from the concurrently running |
70 // application. Using 1/4 of available threads for concurrent GC seems a good |
70 // application. Using 1/4 of available threads for concurrent GC seems a good |
71 // compromise here. |
71 // compromise here. |
72 bool ergo_conc = FLAG_IS_DEFAULT(ConcGCThreads); |
72 bool ergo_conc = FLAG_IS_DEFAULT(ConcGCThreads); |
73 if (ergo_conc) { |
73 if (ergo_conc) { |
74 FLAG_SET_DEFAULT(ConcGCThreads, MAX2(1, os::processor_count() / 4)); |
74 FLAG_SET_DEFAULT(ConcGCThreads, MAX2(1, os::initial_active_processor_count() / 4)); |
75 } |
75 } |
76 |
76 |
77 if (ConcGCThreads == 0) { |
77 if (ConcGCThreads == 0) { |
78 vm_exit_during_initialization("Shenandoah expects ConcGCThreads > 0, check -XX:ConcGCThreads=#"); |
78 vm_exit_during_initialization("Shenandoah expects ConcGCThreads > 0, check -XX:ConcGCThreads=#"); |
79 } |
79 } |
83 // that will overwhelm the OS scheduler. Using 1/2 of available threads seems to be a fair |
83 // that will overwhelm the OS scheduler. Using 1/2 of available threads seems to be a fair |
84 // compromise here. Due to implementation constraints, it should not be lower than |
84 // compromise here. Due to implementation constraints, it should not be lower than |
85 // the number of concurrent threads. |
85 // the number of concurrent threads. |
86 bool ergo_parallel = FLAG_IS_DEFAULT(ParallelGCThreads); |
86 bool ergo_parallel = FLAG_IS_DEFAULT(ParallelGCThreads); |
87 if (ergo_parallel) { |
87 if (ergo_parallel) { |
88 FLAG_SET_DEFAULT(ParallelGCThreads, MAX2(1, os::processor_count() / 2)); |
88 FLAG_SET_DEFAULT(ParallelGCThreads, MAX2(1, os::initial_active_processor_count() / 2)); |
89 } |
89 } |
90 |
90 |
91 if (ParallelGCThreads == 0) { |
91 if (ParallelGCThreads == 0) { |
92 vm_exit_during_initialization("Shenandoah expects ParallelGCThreads > 0, check -XX:ParallelGCThreads=#"); |
92 vm_exit_during_initialization("Shenandoah expects ParallelGCThreads > 0, check -XX:ParallelGCThreads=#"); |
93 } |
93 } |