2405 tty->print_cr(" Average compilation speed : %8d bytes/s", bps); 2406 tty->cr(); 2407 tty->print_cr(" nmethod code size : %8d bytes", nmethods_code_size); 2408 tty->print_cr(" nmethod total size : %8d bytes", nmethods_size); 2409 } 2410 2411 // Debugging output for failure 2412 void CompileBroker::print_last_compile() { 2413 if (_last_compile_level != CompLevel_none && 2414 compiler(_last_compile_level) != NULL && 2415 _last_compile_type != no_compile) { 2416 if (_last_compile_type == osr_compile) { 2417 tty->print_cr("Last parse: [osr]%d+++(%d) %s", 2418 _osr_compilation_id, _last_compile_level, _last_method_compiled); 2419 } else { 2420 tty->print_cr("Last parse: %d+++(%d) %s", 2421 _compilation_id, _last_compile_level, _last_method_compiled); 2422 } 2423 } 2424 } | 2405 tty->print_cr(" Average compilation speed : %8d bytes/s", bps); 2406 tty->cr(); 2407 tty->print_cr(" nmethod code size : %8d bytes", nmethods_code_size); 2408 tty->print_cr(" nmethod total size : %8d bytes", nmethods_size); 2409 } 2410 2411 // Debugging output for failure 2412 void CompileBroker::print_last_compile() { 2413 if (_last_compile_level != CompLevel_none && 2414 compiler(_last_compile_level) != NULL && 2415 _last_compile_type != no_compile) { 2416 if (_last_compile_type == osr_compile) { 2417 tty->print_cr("Last parse: [osr]%d+++(%d) %s", 2418 _osr_compilation_id, _last_compile_level, _last_method_compiled); 2419 } else { 2420 tty->print_cr("Last parse: %d+++(%d) %s", 2421 _compilation_id, _last_compile_level, _last_method_compiled); 2422 } 2423 } 2424 } 2425 2426 //---< BEGIN >--- 8198691: CodeHeap State Analytics. 2427 2428 // Print general/accumulated JIT information. 2429 void CompileBroker::print_info(outputStream *out) { 2430 if (out == NULL) out = tty; 2431 out->cr(); 2432 out->print_cr("======================"); 2433 out->print_cr(" General JIT info "); 2434 out->print_cr("======================"); 2435 out->cr(); 2436 out->print_cr(" JIT is : %7s", should_compile_new_jobs() ? "on" : "off"); 2437 out->print_cr(" Compiler threads : %7d", (int)CICompilerCount); 2438 out->cr(); 2439 out->print_cr("CodeCache overview"); 2440 out->print_cr("--------------------------------------------------------"); 2441 out->cr(); 2442 out->print_cr(" Reserved size : " SIZE_FORMAT_W(7) " KB", CodeCache::max_capacity() / K); 2443 out->print_cr(" Committed size : " SIZE_FORMAT_W(7) " KB", CodeCache::capacity() / K); 2444 out->print_cr(" Unallocated capacity : " SIZE_FORMAT_W(7) " KB", CodeCache::unallocated_capacity() / K); 2445 out->cr(); 2446 2447 out->cr(); 2448 out->print_cr("CodeCache cleaning overview"); 2449 out->print_cr("--------------------------------------------------------"); 2450 out->cr(); 2451 NMethodSweeper::print(out); 2452 out->print_cr("--------------------------------------------------------"); 2453 out->cr(); 2454 } 2455 2456 void CompileBroker::print_heapinfo(outputStream *out, const char* function, const char* granularity) { 2457 TimeStamp ts_total; 2458 TimeStamp ts_lockWait; 2459 TimeStamp ts_lockHold; 2460 TimeStamp ts_print; 2461 2462 ts_total.update(); // record starting point 2463 2464 bool allFun = !strcmp(function, "all"); 2465 bool aggregate = !strcmp(function, "aggregate"); 2466 if (out == NULL) out = tty; 2467 2468 if (allFun || aggregate) { 2469 print_info(out); 2470 } 2471 2472 // It should be sufficient to hold the CodeCache_lock only for the aggregate step. 2473 // All other functions operate on aggregated data - except MethodNames, but that should be safe. 2474 // The separate CodeHeapStateAnalytics_lock protects the printing functions against 2475 // concurrent aggregate steps. Acquire this lock before acquiring the CodeCache_lock. 2476 // CodeHeapStateAnalytics_lock could be held by a concurrent thread for a long time, 2477 // leading to an unnecessarily long hold time of the CodeCache_lock. 2478 if (allFun || aggregate) { 2479 ts_lockWait.update(); // record starting point 2480 MutexLockerEx mu1(CodeHeapStateAnalytics_lock, Mutex::_no_safepoint_check_flag); 2481 MutexLockerEx mu2(CodeCache_lock, Mutex::_no_safepoint_check_flag); 2482 out->cr(); 2483 out->print_cr("__ CodeHeapStateAnalytics + CodeCache lock wait took %10.3f seconds _________", ts_lockWait.seconds()); 2484 out->cr(); 2485 2486 ts_lockHold.update(); // record starting point 2487 CodeCache::aggregate(out, granularity); 2488 out->cr(); 2489 out->print_cr("__ CodeHeapStateAnalytics + CodeCache lock hold took %10.3f seconds _________", ts_lockHold.seconds()); 2490 out->cr(); 2491 } 2492 2493 { 2494 ts_lockWait.update(); // record starting point 2495 MutexLockerEx mu1(CodeHeapStateAnalytics_lock, Mutex::_no_safepoint_check_flag); 2496 out->cr(); 2497 out->print_cr("__ CodeHeapStateAnalytics lock wait took %10.3f seconds _________", ts_lockWait.seconds()); 2498 out->cr(); 2499 ts_print.update(); // record starting point 2500 if (allFun || !strcmp(function, "UsedSpace") ) CodeCache::print_usedSpace(out); 2501 if (allFun || !strcmp(function, "FreeSpace") ) CodeCache::print_freeSpace(out); 2502 if (allFun || !strcmp(function, "MethodCount")) CodeCache::print_count(out); 2503 if (allFun || !strcmp(function, "MethodSpace")) CodeCache::print_space(out); 2504 if (allFun || !strcmp(function, "MethodAge") ) CodeCache::print_age(out); 2505 if (allFun || !strcmp(function, "MethodNames")) CodeCache::print_names(out); 2506 if (allFun || !strcmp(function, "discard") ) CodeCache::discard(out); 2507 out->cr(); 2508 out->print_cr("__ printStat took %10.3f seconds _________", ts_print.seconds()); 2509 out->cr(); 2510 } 2511 out->cr(); 2512 out->print_cr("__ total duration %10.3f seconds _________", ts_total.seconds()); 2513 out->cr(); 2514 } 2515 //---< END >--- 8198691: CodeHeap State Analytics. |