changeset 5415:ab274453d37f

8022883: Assertion failed: sweptCount >= flushedCount + markedCount + zombifiedCount Summary: Provide correct number of visited nmethods to Tracing Reviewed-by: kvn, iveresov
author anoll
date Wed, 18 Sep 2013 07:22:20 +0200
parents a4788ba67e20
children 04cbe2026912
files src/share/vm/runtime/sweeper.cpp
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);