Skip to content

Commit a74c099

Browse files
author
Lin Zang
committed
8252842: Extend jmap to support parallel heap dump
Reviewed-by: rschmelter, cjplummer
1 parent 2166ed1 commit a74c099

File tree

6 files changed

+787
-192
lines changed

6 files changed

+787
-192
lines changed

src/hotspot/share/services/attachListener.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,15 @@ jint dump_heap(AttachOperation* op, outputStream* out) {
243243
return JNI_ERR;
244244
}
245245
}
246+
// Parallel thread number for heap dump, initialize based on active processor count.
247+
// Note the real number of threads used is also determined by active workers and compression
248+
// backend thread number. See heapDumper.cpp.
249+
uint parallel_thread_num = MAX2<uint>(1, (uint)os::initial_active_processor_count() * 3 / 8);
246250
// Request a full GC before heap dump if live_objects_only = true
247251
// This helps reduces the amount of unreachable objects in the dump
248252
// and makes it easier to browse.
249253
HeapDumper dumper(live_objects_only /* request GC */);
250-
dumper.dump(op->arg(0), out, (int)level);
254+
dumper.dump(path, out, (int)level, false, (uint)parallel_thread_num);
251255
}
252256
return JNI_OK;
253257
}

0 commit comments

Comments
 (0)