Skip to content
Browse files
8252842: Extend jmap to support parallel heap dump
Reviewed-by: rschmelter, cjplummer
  • Loading branch information
Lin Zang committed Sep 23, 2021
1 parent 2166ed1 commit a74c099d67272b2ef542405d30db62a82cbbebc6
Showing 6 changed files with 787 additions and 192 deletions.
@@ -243,11 +243,15 @@ jint dump_heap(AttachOperation* op, outputStream* out) {
return JNI_ERR;
// Parallel thread number for heap dump, initialize based on active processor count.
// Note the real number of threads used is also determined by active workers and compression
// backend thread number. See heapDumper.cpp.
uint parallel_thread_num = MAX2<uint>(1, (uint)os::initial_active_processor_count() * 3 / 8);
// Request a full GC before heap dump if live_objects_only = true
// This helps reduces the amount of unreachable objects in the dump
// and makes it easier to browse.
HeapDumper dumper(live_objects_only /* request GC */);
dumper.dump(op->arg(0), out, (int)level);
dumper.dump(path, out, (int)level, false, (uint)parallel_thread_num);
return JNI_OK;

1 comment on commit a74c099

Copy link

@openjdk-notifier openjdk-notifier bot commented on a74c099 Sep 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.