< prev index next >

src/share/vm/gc/shared/adaptiveSizePolicy.hpp

Print this page
rev 13243 : 8179268: Factor out AdaptiveSizePolicy from top-level interfaces CollectorPolicy and CollectedHeap
Reviewed-by: pliden, mgerdin


 488                                GCCause::Cause gc_cause,
 489                                CollectorPolicy* collector_policy);
 490 
 491   static bool should_update_promo_stats(GCCause::Cause cause) {
 492     return ((GCCause::is_user_requested_gc(cause)  &&
 493                UseAdaptiveSizePolicyWithSystemGC) ||
 494             GCCause::is_tenured_allocation_failure_gc(cause));
 495   }
 496 
 497   static bool should_update_eden_stats(GCCause::Cause cause) {
 498     return ((GCCause::is_user_requested_gc(cause)  &&
 499                UseAdaptiveSizePolicyWithSystemGC) ||
 500             GCCause::is_allocation_failure_gc(cause));
 501   }
 502 
 503   // Printing support
 504   virtual bool print() const;
 505   void print_tenuring_threshold(uint new_tenuring_threshold) const;
 506 };
 507 
 508 // Class that can be used to print information about the
 509 // adaptive size policy at intervals specified by
 510 // AdaptiveSizePolicyOutputInterval.  Only print information
 511 // if an adaptive size policy is in use.
 512 class AdaptiveSizePolicyOutput : StackObj {
 513   static bool enabled() {
 514     return UseParallelGC &&
 515            UseAdaptiveSizePolicy &&
 516            log_is_enabled(Debug, gc, ergo);
 517   }
 518  public:
 519   static void print() {
 520     if (enabled()) {
 521       Universe::heap()->size_policy()->print();
 522     }
 523   }
 524 
 525   static void print(AdaptiveSizePolicy* size_policy, uint count) {
 526     bool do_print =
 527         enabled() &&
 528         (AdaptiveSizePolicyOutputInterval > 0) &&
 529         (count % AdaptiveSizePolicyOutputInterval) == 0;
 530 
 531     if (do_print) {
 532       size_policy->print();
 533     }
 534   }
 535 };
 536 
 537 #endif // SHARE_VM_GC_SHARED_ADAPTIVESIZEPOLICY_HPP


 488                                GCCause::Cause gc_cause,
 489                                CollectorPolicy* collector_policy);
 490 
 491   static bool should_update_promo_stats(GCCause::Cause cause) {
 492     return ((GCCause::is_user_requested_gc(cause)  &&
 493                UseAdaptiveSizePolicyWithSystemGC) ||
 494             GCCause::is_tenured_allocation_failure_gc(cause));
 495   }
 496 
 497   static bool should_update_eden_stats(GCCause::Cause cause) {
 498     return ((GCCause::is_user_requested_gc(cause)  &&
 499                UseAdaptiveSizePolicyWithSystemGC) ||
 500             GCCause::is_allocation_failure_gc(cause));
 501   }
 502 
 503   // Printing support
 504   virtual bool print() const;
 505   void print_tenuring_threshold(uint new_tenuring_threshold) const;
 506 };
 507 





























 508 #endif // SHARE_VM_GC_SHARED_ADAPTIVESIZEPOLICY_HPP
< prev index next >