mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8000244: G1: Ergonomically set MarkStackSize and use virtual space for global marking stack
Set the value of MarkStackSize to a value based on the number of parallel marking threads with a reasonable minimum. Expand the marking stack if we have to restart marking due to an overflow up to a reasonable maximum. Allocate the underlying space for the marking stack from virtual memory. Reviewed-by: jmasa, brutisso
This commit is contained in:
parent
e74d551608
commit
aac13806ea
4 changed files with 271 additions and 110 deletions
|
@ -1499,13 +1499,12 @@ void Arguments::set_g1_gc_flags() {
|
|||
Abstract_VM_Version::parallel_worker_threads());
|
||||
}
|
||||
|
||||
if (FLAG_IS_DEFAULT(MarkStackSize)) {
|
||||
FLAG_SET_DEFAULT(MarkStackSize, 128 * TASKQUEUE_SIZE);
|
||||
}
|
||||
if (PrintGCDetails && Verbose) {
|
||||
tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk",
|
||||
MarkStackSize / K, MarkStackSizeMax / K);
|
||||
tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
|
||||
// MarkStackSize will be set (if it hasn't been set by the user)
|
||||
// when concurrent marking is initialized.
|
||||
// Its value will be based upon the number of parallel marking threads.
|
||||
// But we do set the maximum mark stack size here.
|
||||
if (FLAG_IS_DEFAULT(MarkStackSizeMax)) {
|
||||
FLAG_SET_DEFAULT(MarkStackSizeMax, 128 * TASKQUEUE_SIZE);
|
||||
}
|
||||
|
||||
if (FLAG_IS_DEFAULT(GCTimeRatio) || GCTimeRatio == 0) {
|
||||
|
@ -1517,6 +1516,12 @@ void Arguments::set_g1_gc_flags() {
|
|||
// is allocation). We might consider increase it further.
|
||||
FLAG_SET_DEFAULT(GCTimeRatio, 9);
|
||||
}
|
||||
|
||||
if (PrintGCDetails && Verbose) {
|
||||
tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk",
|
||||
MarkStackSize / K, MarkStackSizeMax / K);
|
||||
tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
|
||||
}
|
||||
}
|
||||
|
||||
void Arguments::set_heap_size() {
|
||||
|
@ -1980,6 +1985,9 @@ bool Arguments::check_vm_args_consistency() {
|
|||
status = status && verify_min_value(ClassMetaspaceSize, 1*M,
|
||||
"ClassMetaspaceSize");
|
||||
|
||||
status = status && verify_interval(MarkStackSizeMax,
|
||||
1, (max_jint - 1), "MarkStackSizeMax");
|
||||
|
||||
#ifdef SPARC
|
||||
if (UseConcMarkSweepGC || UseG1GC) {
|
||||
// Issue a stern warning if the user has explicitly set
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue