hotspot/src/share/vm/code/codeCache.cpp
void CodeCache::print() {
{- -------------------------------------------
(1) (変数宣言など)
---------------------------------------- -}
CodeBlob_sizes live;
CodeBlob_sizes dead;
{- -------------------------------------------
(1) CodeBlob の情報を CodeBlob_sizes 内に集めていく
---------------------------------------- -}
FOR_ALL_BLOBS(p) {
if (!p->is_alive()) {
dead.add(p);
} else {
live.add(p);
}
}
{- -------------------------------------------
(1) CodeBlob_sizes 内に集めた情報を出力する
---------------------------------------- -}
tty->print_cr("CodeCache:");
tty->print_cr("nmethod dependency checking time %f", dependentCheckTime.seconds(),
dependentCheckTime.seconds() / dependentCheckCount);
if (!live.is_empty()) {
live.print("live");
}
if (!dead.is_empty()) {
dead.print("dead");
}
{- -------------------------------------------
(1) Verbose オプションがセットされている場合は OopMap 情報も出力する
---------------------------------------- -}
if (Verbose) {
// print the oop_map usage
int code_size = 0;
int number_of_blobs = 0;
int number_of_oop_maps = 0;
int map_size = 0;
FOR_ALL_BLOBS(p) {
if (p->is_alive()) {
number_of_blobs++;
code_size += p->code_size();
OopMapSet* set = p->oop_maps();
if (set != NULL) {
number_of_oop_maps += set->size();
map_size += set->heap_size();
}
}
}
tty->print_cr("OopMaps");
tty->print_cr(" #blobs = %d", number_of_blobs);
tty->print_cr(" code size = %d", code_size);
tty->print_cr(" #oop_maps = %d", number_of_oop_maps);
tty->print_cr(" map size = %d", map_size);
}
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.