mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 10:34:38 +02:00
8179268: Factor out AdaptiveSizePolicy from top-level interfaces CollectorPolicy and CollectedHeap
Reviewed-by: pliden, sjohanss
This commit is contained in:
parent
b4d5834c9d
commit
313f3e3ef5
7 changed files with 55 additions and 47 deletions
|
@ -266,4 +266,33 @@ private:
|
|||
size_t _metadata_used;
|
||||
};
|
||||
|
||||
// Class that can be used to print information about the
|
||||
// adaptive size policy at intervals specified by
|
||||
// AdaptiveSizePolicyOutputInterval. Only print information
|
||||
// if an adaptive size policy is in use.
|
||||
class AdaptiveSizePolicyOutput : AllStatic {
|
||||
static bool enabled() {
|
||||
return UseParallelGC &&
|
||||
UseAdaptiveSizePolicy &&
|
||||
log_is_enabled(Debug, gc, ergo);
|
||||
}
|
||||
public:
|
||||
static void print() {
|
||||
if (enabled()) {
|
||||
ParallelScavengeHeap::heap()->size_policy()->print();
|
||||
}
|
||||
}
|
||||
|
||||
static void print(AdaptiveSizePolicy* size_policy, uint count) {
|
||||
bool do_print =
|
||||
enabled() &&
|
||||
(AdaptiveSizePolicyOutputInterval > 0) &&
|
||||
(count % AdaptiveSizePolicyOutputInterval) == 0;
|
||||
|
||||
if (do_print) {
|
||||
size_policy->print();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#endif // SHARE_VM_GC_PARALLEL_PARALLELSCAVENGEHEAP_HPP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue