hotspot/src/share/vm/services/memSnapshot.cpp
changeset 15104 f5d78994619f
parent 14569 96937297368d
child 15797 43706e10feea
equal deleted inserted replaced
14739:12125dacc077 15104:f5d78994619f
   382   }
   382   }
   383 
   383 
   384   _staging_area.init();
   384   _staging_area.init();
   385   _lock = new (std::nothrow) Mutex(Monitor::max_nonleaf - 1, "memSnapshotLock");
   385   _lock = new (std::nothrow) Mutex(Monitor::max_nonleaf - 1, "memSnapshotLock");
   386   NOT_PRODUCT(_untracked_count = 0;)
   386   NOT_PRODUCT(_untracked_count = 0;)
       
   387   _number_of_classes = 0;
   387 }
   388 }
   388 
   389 
   389 MemSnapshot::~MemSnapshot() {
   390 MemSnapshot::~MemSnapshot() {
   390   assert(MemTracker::shutdown_in_progress(), "native memory tracking still on");
   391   assert(MemTracker::shutdown_in_progress(), "native memory tracking still on");
   391   {
   392   {
   477   return true;
   478   return true;
   478 }
   479 }
   479 
   480 
   480 
   481 
   481 // promote data to next generation
   482 // promote data to next generation
   482 bool MemSnapshot::promote() {
   483 bool MemSnapshot::promote(int number_of_classes) {
   483   assert(_alloc_ptrs != NULL && _vm_ptrs != NULL, "Just check");
   484   assert(_alloc_ptrs != NULL && _vm_ptrs != NULL, "Just check");
   484   assert(_staging_area.malloc_data() != NULL && _staging_area.vm_data() != NULL,
   485   assert(_staging_area.malloc_data() != NULL && _staging_area.vm_data() != NULL,
   485          "Just check");
   486          "Just check");
   486   MutexLockerEx lock(_lock, true);
   487   MutexLockerEx lock(_lock, true);
   487 
   488 
   494     }
   495     }
   495   }
   496   }
   496 
   497 
   497   NOT_PRODUCT(check_malloc_pointers();)
   498   NOT_PRODUCT(check_malloc_pointers();)
   498   _staging_area.clear();
   499   _staging_area.clear();
       
   500   _number_of_classes = number_of_classes;
   499   return promoted;
   501   return promoted;
   500 }
   502 }
   501 
   503 
   502 bool MemSnapshot::promote_malloc_records(MemPointerArrayIterator* itr) {
   504 bool MemSnapshot::promote_malloc_records(MemPointerArrayIterator* itr) {
   503   MemPointerIterator malloc_snapshot_itr(_alloc_ptrs);
   505   MemPointerIterator malloc_snapshot_itr(_alloc_ptrs);