This discussion is archived
5 Replies Latest reply: Jun 20, 2011 5:36 PM by 867527 RSS

Statistics for BinaryTreeDictionary does not correctly support large heaps

867527 Newbie
Currently Being Moderated
When using JVM options "-XX:+UseConcMarkSweepGC -Xms65g -Xmx65g. When -XX:PrintFLSStatistics=1" the following output is seen:

Statistics for BinaryTreeDictionary:
------------------------------------
Total Free Space: -1824684952
Max Chunk Size: -1824684952
Number of Blocks: 1
Av. Block Size: -1824684952
Tree Height: 1

(Notice the negative sizes)

The source for this is (hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp):

void BinaryTreeDictionary::reportStatistics() const {
verify_par_locked();
gclog_or_tty->print("Statistics for BinaryTreeDictionary:\n"
"------------------------------------\n");
size_t totalSize = totalChunkSize(debug_only(NULL));
size_t freeBlocks = numFreeBlocks();
gclog_or_tty->print("Total Free Space: %d\n", totalSize);
gclog_or_tty->print("Max Chunk Size: %d\n", maxChunkSize());
gclog_or_tty->print("Number of Blocks: %d\n", freeBlocks);
if (freeBlocks > 0) {
gclog_or_tty->print("Av. Block Size: %d\n", totalSize/freeBlocks);
}
gclog_or_tty->print("Tree Height: %d\n", treeHeight());
}

“%d” just doesn’t cut it with a “long”‘s worth of data.

(http://blog.aggregateknowledge.com/2011/04/29/very-large-heaps-in-java/)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points