# HG changeset patch # User anoll # Date 1379481740 -7200 # Node ID ab274453d37f0230d94134f968d784c315f0d009 # Parent a4788ba67e20f42bbaef0bcb2e504c6062fb84ae 8022883: Assertion failed: sweptCount >= flushedCount + markedCount + zombifiedCount Summary: Provide correct number of visited nmethods to Tracing Reviewed-by: kvn, iveresov diff -r a4788ba67e20 -r ab274453d37f src/share/vm/runtime/sweeper.cpp --- a/src/share/vm/runtime/sweeper.cpp Tue Sep 17 16:07:37 2013 -0700 +++ b/src/share/vm/runtime/sweeper.cpp Wed Sep 18 07:22:20 2013 +0200 @@ -269,6 +269,7 @@ // the number of nmethods changes during the sweep so the final // stage must iterate until it there are no more nmethods. int todo = (CodeCache::nof_nmethods() - _seen) / _invocations; + int swept_count = 0; assert(!SafepointSynchronize::is_at_safepoint(), "should not be in safepoint when we get here"); assert(!CodeCache_lock->owned_by_self(), "just checking"); @@ -278,6 +279,7 @@ // The last invocation iterates until there are no more nmethods for (int i = 0; (i < todo || _invocations == 1) && _current != NULL; i++) { + swept_count++; if (SafepointSynchronize::is_synchronizing()) { // Safepoint request if (PrintMethodFlushing && Verbose) { tty->print_cr("### Sweep at %d out of %d, invocation: %d, yielding to safepoint", _seen, CodeCache::nof_nmethods(), _invocations); @@ -331,7 +333,7 @@ event.set_endtime(sweep_end_counter); event.set_sweepIndex(_traversals); event.set_sweepFractionIndex(NmethodSweepFraction - _invocations + 1); - event.set_sweptCount(todo); + event.set_sweptCount(swept_count); event.set_flushedCount(_flushed_count); event.set_markedCount(_marked_count); event.set_zombifiedCount(_zombified_count);