equal
deleted
inserted
replaced
401 |
401 |
402 void NMethodSweeper::sweep_code_cache() { |
402 void NMethodSweeper::sweep_code_cache() { |
403 ResourceMark rm; |
403 ResourceMark rm; |
404 Ticks sweep_start_counter = Ticks::now(); |
404 Ticks sweep_start_counter = Ticks::now(); |
405 |
405 |
|
406 log_debug(codecache, sweep, start)("CodeCache flushing"); |
|
407 |
406 int flushed_count = 0; |
408 int flushed_count = 0; |
407 int zombified_count = 0; |
409 int zombified_count = 0; |
408 int flushed_c2_count = 0; |
410 int flushed_c2_count = 0; |
409 |
411 |
410 if (PrintMethodFlushing && Verbose) { |
412 if (PrintMethodFlushing && Verbose) { |
498 if(PrintMethodFlushing) { |
500 if(PrintMethodFlushing) { |
499 tty->print_cr("### sweeper: sweep time(" JLONG_FORMAT "): ", sweep_time.value()); |
501 tty->print_cr("### sweeper: sweep time(" JLONG_FORMAT "): ", sweep_time.value()); |
500 } |
502 } |
501 #endif |
503 #endif |
502 |
504 |
|
505 Log(codecache, sweep) log; |
|
506 if (log.is_debug()) { |
|
507 CodeCache::print_summary(log.debug_stream(), false); |
|
508 } |
503 log_sweep("finished"); |
509 log_sweep("finished"); |
504 |
510 |
505 // Sweeper is the only case where memory is released, check here if it |
511 // Sweeper is the only case where memory is released, check here if it |
506 // is time to restart the compiler. Only checking if there is a certain |
512 // is time to restart the compiler. Only checking if there is a certain |
507 // amount of free memory in the code cache might lead to re-enabling |
513 // amount of free memory in the code cache might lead to re-enabling |
511 // it only makes sense to re-enable compilation if we have actually freed memory. |
517 // it only makes sense to re-enable compilation if we have actually freed memory. |
512 // Note that typically several kB are released for sweeping 16MB of the code |
518 // Note that typically several kB are released for sweeping 16MB of the code |
513 // cache. As a result, 'freed_memory' > 0 to restart the compiler. |
519 // cache. As a result, 'freed_memory' > 0 to restart the compiler. |
514 if (!CompileBroker::should_compile_new_jobs() && (freed_memory > 0)) { |
520 if (!CompileBroker::should_compile_new_jobs() && (freed_memory > 0)) { |
515 CompileBroker::set_should_compile_new_jobs(CompileBroker::run_compilation); |
521 CompileBroker::set_should_compile_new_jobs(CompileBroker::run_compilation); |
|
522 log.debug("restart compiler"); |
516 log_sweep("restart_compiler"); |
523 log_sweep("restart_compiler"); |
517 } |
524 } |
518 } |
525 } |
519 |
526 |
520 /** |
527 /** |