comparison src/share/vm/services/memSnapshot.cpp @ 7464:ecd24264898b

8005048: NMT: #loaded classes needs to just show the # defined classes Summary: Count number of instance classes so that it matches class metadata size Reviewed-by: coleenp, acorn
author zgu
date Tue, 08 Jan 2013 14:04:25 -0500
parents 49cbd3e25ba9
children fc64254f5579
comparison
equal deleted inserted replaced
7396:4a2ed49abd51 7464:ecd24264898b
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);