src/share/vm/services/memRecorder.cpp

Print this page
rev 3953 : JDK-8005012: Add WB APIs to better support NMT testing
Summary:

@@ -53,11 +53,11 @@
 volatile jint MemRecorder::_instance_count = 0;
 
 MemRecorder::MemRecorder() {
   assert(MemTracker::is_on(), "Native memory tracking is off");
   Atomic::inc(&_instance_count);
-  debug_only(set_generation();)
+  set_generation();
 
   if (MemTracker::track_callsite()) {
     _pointer_records = new (std::nothrow)FixedSizeMemPointerArray<SeqMemPointerRecordEx,
         DEFAULT_RECORDER_PTR_ARRAY_SIZE>();
   } else {

@@ -149,15 +149,16 @@
   _pointer_records->sort((FN_SORT)sort_record_fn);
   return SequencedRecordIterator(_pointer_records);
 }
 
 
-#ifdef ASSERT
 void MemRecorder::set_generation() {
   _generation = SequenceGenerator::current_generation();
 }
 
+#ifdef ASSERT
+
 void MemRecorder::check_dup_seq(jint seq) const {
   MemPointerArrayIteratorImpl itr(_pointer_records);
   MemPointerRecord* rc = (MemPointerRecord*)itr.current();
   while (rc != NULL) {
     assert(rc->seq() != seq, "dup seq");