36 #include "gc/shared/referenceProcessor.hpp" |
36 #include "gc/shared/referenceProcessor.hpp" |
37 #include "gc/shared/softRefPolicy.hpp" |
37 #include "gc/shared/softRefPolicy.hpp" |
38 #include "gc/shared/strongRootsScope.hpp" |
38 #include "gc/shared/strongRootsScope.hpp" |
39 #include "logging/log.hpp" |
39 #include "logging/log.hpp" |
40 #include "memory/metaspace.hpp" |
40 #include "memory/metaspace.hpp" |
|
41 #include "memory/metaspace/metaspaceSizesSnapshot.hpp" |
41 #include "utilities/growableArray.hpp" |
42 #include "utilities/growableArray.hpp" |
42 #include "utilities/ostream.hpp" |
43 #include "utilities/ostream.hpp" |
43 |
44 |
44 class AdjoiningGenerations; |
45 class AdjoiningGenerations; |
45 class GCHeapSummary; |
46 class GCHeapSummary; |
255 class PreGCValues { |
256 class PreGCValues { |
256 public: |
257 public: |
257 PreGCValues(ParallelScavengeHeap* heap) : |
258 PreGCValues(ParallelScavengeHeap* heap) : |
258 _heap_used(heap->used()), |
259 _heap_used(heap->used()), |
259 _young_gen_used(heap->young_gen()->used_in_bytes()), |
260 _young_gen_used(heap->young_gen()->used_in_bytes()), |
260 _old_gen_used(heap->old_gen()->used_in_bytes()), |
261 _old_gen_used(heap->old_gen()->used_in_bytes()) { } |
261 _metadata_used(MetaspaceUtils::used_bytes()) { }; |
|
262 |
262 |
263 size_t heap_used() const { return _heap_used; } |
263 size_t heap_used() const { return _heap_used; } |
264 size_t young_gen_used() const { return _young_gen_used; } |
264 size_t young_gen_used() const { return _young_gen_used; } |
265 size_t old_gen_used() const { return _old_gen_used; } |
265 size_t old_gen_used() const { return _old_gen_used; } |
266 size_t metadata_used() const { return _metadata_used; } |
266 const metaspace::MetaspaceSizesSnapshot& metaspace_sizes() const { return _meta_sizes; } |
267 |
267 |
268 private: |
268 private: |
269 size_t _heap_used; |
269 size_t _heap_used; |
270 size_t _young_gen_used; |
270 size_t _young_gen_used; |
271 size_t _old_gen_used; |
271 size_t _old_gen_used; |
272 size_t _metadata_used; |
272 const metaspace::MetaspaceSizesSnapshot _meta_sizes; |
273 }; |
273 }; |
274 |
274 |
275 // Class that can be used to print information about the |
275 // Class that can be used to print information about the |
276 // adaptive size policy at intervals specified by |
276 // adaptive size policy at intervals specified by |
277 // AdaptiveSizePolicyOutputInterval. Only print information |
277 // AdaptiveSizePolicyOutputInterval. Only print information |