--- a/hotspot/src/share/vm/gc/g1/g1CardLiveData.cpp Mon May 02 10:24:41 2016 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1CardLiveData.cpp Mon May 02 10:24:41 2016 +0200
@@ -424,9 +424,12 @@
guarantee(Universe::is_fully_initialized(), "Should not call this during initialization.");
size_t const num_chunks = align_size_up(live_cards_bm().size_in_bytes(), G1ClearCardLiveDataTask::chunk_size()) / G1ClearCardLiveDataTask::chunk_size();
+ uint const num_workers = (uint)MIN2(num_chunks, (size_t)workers->active_workers());
G1ClearCardLiveDataTask cl(live_cards_bm(), num_chunks);
- workers->run_task(&cl);
+
+ log_debug(gc, ergo)("Running %s using %u workers for " SIZE_FORMAT " work units.", cl.name(), num_workers, num_chunks);
+ workers->run_task(&cl, num_workers);
// The region live bitmap is always very small, even for huge heaps. Clear
// directly.