comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 846:42d84bbbecf4

6859911: G1: assert(Heap_lock->owner() = NULL, "Should be owned on this thread's behalf") Summary: The used() method assumes that the heap lock is held when it is called. However, when used() is called from print_on(), this is not the case. Reviewed-by: ysr, jmasa
author tonyp
date Wed, 15 Jul 2009 12:22:59 -0400
parents df6caf649ff7
children 45d97a99715b
comparison
equal deleted inserted replaced
845:df6caf649ff7 846:42d84bbbecf4
1664 if (hr != NULL) 1664 if (hr != NULL)
1665 result += hr->used(); 1665 result += hr->used();
1666 return result; 1666 return result;
1667 } 1667 }
1668 1668
1669 size_t G1CollectedHeap::used_unlocked() const {
1670 size_t result = _summary_bytes_used;
1671 return result;
1672 }
1673
1669 class SumUsedClosure: public HeapRegionClosure { 1674 class SumUsedClosure: public HeapRegionClosure {
1670 size_t _used; 1675 size_t _used;
1671 public: 1676 public:
1672 SumUsedClosure() : _used(0) {} 1677 SumUsedClosure() : _used(0) {}
1673 bool doHeapRegion(HeapRegion* r) { 1678 bool doHeapRegion(HeapRegion* r) {
2347 } 2352 }
2348 2353
2349 void G1CollectedHeap::print_on(outputStream* st, bool extended) const { 2354 void G1CollectedHeap::print_on(outputStream* st, bool extended) const {
2350 st->print(" %-20s", "garbage-first heap"); 2355 st->print(" %-20s", "garbage-first heap");
2351 st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K", 2356 st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K",
2352 capacity()/K, used()/K); 2357 capacity()/K, used_unlocked()/K);
2353 st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")", 2358 st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")",
2354 _g1_storage.low_boundary(), 2359 _g1_storage.low_boundary(),
2355 _g1_storage.high(), 2360 _g1_storage.high(),
2356 _g1_storage.high_boundary()); 2361 _g1_storage.high_boundary());
2357 st->cr(); 2362 st->cr();