提交 d80fd292 编写于 作者: J jcoomes

8057818: collect allocation context statistics at gc pauses

Reviewed-by: mikael, jmasa
上级 9c0f9f58
...@@ -3332,6 +3332,7 @@ void ConcurrentMark::aggregate_count_data() { ...@@ -3332,6 +3332,7 @@ void ConcurrentMark::aggregate_count_data() {
} else { } else {
g1_par_agg_task.work(0); g1_par_agg_task.work(0);
} }
_g1h->allocation_context_stats().update_at_remark();
} }
// Clear the per-worker arrays used to store the per-region counting data // Clear the per-worker arrays used to store the per-region counting data
......
...@@ -41,4 +41,11 @@ public: ...@@ -41,4 +41,11 @@ public:
} }
}; };
class AllocationContextStats: public StackObj {
public:
inline void clear() { }
inline void update(bool full_gc) { }
inline void update_at_remark() { }
};
#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1ALLOCATIONCONTEXT_HPP #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1ALLOCATIONCONTEXT_HPP
...@@ -3585,7 +3585,7 @@ void G1CollectedHeap::gc_prologue(bool full /* Ignored */) { ...@@ -3585,7 +3585,7 @@ void G1CollectedHeap::gc_prologue(bool full /* Ignored */) {
} }
} }
void G1CollectedHeap::gc_epilogue(bool full /* Ignored */) { void G1CollectedHeap::gc_epilogue(bool full) {
if (G1SummarizeRSetStats && if (G1SummarizeRSetStats &&
(G1SummarizeRSetStatsPeriod > 0) && (G1SummarizeRSetStatsPeriod > 0) &&
...@@ -3602,6 +3602,7 @@ void G1CollectedHeap::gc_epilogue(bool full /* Ignored */) { ...@@ -3602,6 +3602,7 @@ void G1CollectedHeap::gc_epilogue(bool full /* Ignored */) {
// always_do_update_barrier = true; // always_do_update_barrier = true;
resize_all_tlabs(); resize_all_tlabs();
allocation_context_stats().update(full);
// We have just completed a GC. Update the soft reference // We have just completed a GC. Update the soft reference
// policy with the new heap occupancy // policy with the new heap occupancy
......
...@@ -263,6 +263,9 @@ private: ...@@ -263,6 +263,9 @@ private:
// Class that handles the different kinds of allocations. // Class that handles the different kinds of allocations.
G1Allocator* _allocator; G1Allocator* _allocator;
// Statistics for each allocation context
AllocationContextStats _allocation_context_stats;
// PLAB sizing policy for survivors. // PLAB sizing policy for survivors.
PLABStats _survivor_plab_stats; PLABStats _survivor_plab_stats;
...@@ -656,6 +659,8 @@ public: ...@@ -656,6 +659,8 @@ public:
// Determines PLAB size for a particular allocation purpose. // Determines PLAB size for a particular allocation purpose.
size_t desired_plab_sz(GCAllocPurpose purpose); size_t desired_plab_sz(GCAllocPurpose purpose);
inline AllocationContextStats& allocation_context_stats();
// Do anything common to GC's. // Do anything common to GC's.
virtual void gc_prologue(bool full); virtual void gc_prologue(bool full);
virtual void gc_epilogue(bool full); virtual void gc_epilogue(bool full);
......
...@@ -37,6 +37,10 @@ ...@@ -37,6 +37,10 @@
// Inline functions for G1CollectedHeap // Inline functions for G1CollectedHeap
inline AllocationContextStats& G1CollectedHeap::allocation_context_stats() {
return _allocation_context_stats;
}
// Return the region with the given index. It assumes the index is valid. // Return the region with the given index. It assumes the index is valid.
inline HeapRegion* G1CollectedHeap::region_at(uint index) const { return _hrm.at(index); } inline HeapRegion* G1CollectedHeap::region_at(uint index) const { return _hrm.at(index); }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册