1.1 --- a/src/share/vm/services/memTracker.cpp Thu Oct 18 13:09:47 2012 -0400 1.2 +++ b/src/share/vm/services/memTracker.cpp Fri Oct 19 21:40:07 2012 -0400 1.3 @@ -364,7 +364,7 @@ 1.4 1.5 if (thread != NULL) { 1.6 if (thread->is_Java_thread() && ((JavaThread*)thread)->is_safepoint_visible()) { 1.7 - JavaThread* java_thread = static_cast<JavaThread*>(thread); 1.8 + JavaThread* java_thread = (JavaThread*)thread; 1.9 JavaThreadState state = java_thread->thread_state(); 1.10 if (SafepointSynchronize::safepoint_safe(java_thread, state)) { 1.11 // JavaThreads that are safepoint safe, can run through safepoint, 1.12 @@ -472,6 +472,8 @@ 1.13 // it should guarantee that NMT is fully sync-ed. 1.14 ThreadCritical tc; 1.15 1.16 + SequenceGenerator::reset(); 1.17 + 1.18 // walk all JavaThreads to collect recorders 1.19 SyncThreadRecorderClosure stc; 1.20 Threads::threads_do(&stc); 1.21 @@ -484,11 +486,12 @@ 1.22 pending_recorders = _global_recorder; 1.23 _global_recorder = NULL; 1.24 } 1.25 - SequenceGenerator::reset(); 1.26 // check _worker_thread with lock to avoid racing condition 1.27 if (_worker_thread != NULL) { 1.28 _worker_thread->at_sync_point(pending_recorders); 1.29 } 1.30 + 1.31 + assert(SequenceGenerator::peek() == 1, "Should not have memory activities during sync-point"); 1.32 } 1.33 } 1.34