uint AdaptiveSizePolicy::calc_active_conc_workers(uintx total_workers,
                                                  uintx active_workers,
                                                  uintx application_workers) {
  if (!UseDynamicNumberOfGCThreads ||
     (!FLAG_IS_DEFAULT(ConcGCThreads) && !ForceDynamicNumberOfGCThreads)) {
    return ConcGCThreads;
  } else {
    uint no_of_gc_threads = calc_default_active_workers(total_workers,
                                                        1, /* Minimum number of workers */
                                                        active_workers,
                                                        application_workers);
    return no_of_gc_threads;
  }
}
Esempio n. 2
0
int AdaptiveSizePolicy::calc_active_workers(uintx total_workers,
                                            uintx active_workers,
                                            uintx application_workers) {
  // If the user has specifically set the number of
  // GC threads, use them.

  // If the user has turned off using a dynamic number of GC threads
  // or the users has requested a specific number, set the active
  // number of workers to all the workers.

  int new_active_workers;
  if (!UseDynamicNumberOfGCThreads ||
     (!FLAG_IS_DEFAULT(ParallelGCThreads) && !ForceDynamicNumberOfGCThreads)) {
    new_active_workers = total_workers;
  } else {
    new_active_workers = calc_default_active_workers(total_workers,
                                                     2, /* Minimum number of workers */
                                                     active_workers,
                                                     application_workers);
  }
  assert(new_active_workers > 0, "Always need at least 1");
  return new_active_workers;
}