< prev index next >
src/hotspot/share/gc/g1/g1IHOPControl.hpp
Print this page
rev 60584 : imported patch 8245511-ihop
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
@@ -23,10 +23,11 @@
*/
#ifndef SHARE_GC_G1_G1IHOPCONTROL_HPP
#define SHARE_GC_G1_G1IHOPCONTROL_HPP
+#include "gc/g1/g1OldGenAllocationTracker.hpp"
#include "memory/allocation.hpp"
#include "utilities/numberSeq.hpp"
class G1Predictions;
class G1NewTracer;
@@ -42,16 +43,16 @@
// of bytes when marking should be finished and reclaim started.
size_t _target_occupancy;
// Most recent complete mutator allocation period in seconds.
double _last_allocation_time_s;
- // Amount of bytes allocated during _last_allocation_time_s.
- size_t _last_allocated_bytes;
- // Initialize an instance with the initial IHOP value in percent. The target
- // occupancy will be updated at the first heap expansion.
- G1IHOPControl(double initial_ihop_percent);
+ const G1OldGenAllocationTracker* _old_gen_alloc_tracker;
+ // Initialize an instance with the old gen allocation tracker and the
+ // initial IHOP value in percent. The target occupancy will be updated
+ // at the first heap expansion.
+ G1IHOPControl(double ihop_percent, G1OldGenAllocationTracker const* old_gen_alloc_tracker);
// Most recent time from the end of the concurrent start to the start of the first
// mixed gc.
virtual double last_marking_length_s() const = 0;
public:
@@ -68,11 +69,11 @@
// allocation, e.g. any waste caused by TLAB allocation, space at the end of
// humongous objects that can not be used for allocation, etc.
// Together with the target occupancy, this additional buffer should contain the
// difference between old gen size and total heap size at the start of reclamation,
// and space required for that reclamation.
- virtual void update_allocation_info(double allocation_time_s, size_t allocated_bytes, size_t additional_buffer_size);
+ virtual void update_allocation_info(double allocation_time_s, size_t additional_buffer_size);
// Update the time spent in the mutator beginning from the end of concurrent start to
// the first mixed gc.
virtual void update_marking_length(double marking_length_s) = 0;
virtual void print();
@@ -86,11 +87,11 @@
// first mixed gc.
double _last_marking_length_s;
protected:
double last_marking_length_s() const { return _last_marking_length_s; }
public:
- G1StaticIHOPControl(double ihop_percent);
+ G1StaticIHOPControl(double ihop_percent, G1OldGenAllocationTracker const* old_gen_alloc_tracker);
size_t get_conc_mark_start_threshold() {
guarantee(_target_occupancy > 0, "Target occupancy must have been initialized.");
return (size_t) (_initial_ihop_percent * _target_occupancy / 100.0);
}
@@ -130,21 +131,26 @@
// The "actual" target threshold the algorithm wants to keep during and at the
// end of marking. This is typically lower than the requested threshold, as the
// algorithm needs to consider restrictions by the environment.
size_t actual_target_threshold() const;
+
+ // This method calculates the old gen allocation rate based on the net survived
+ // bytes that are allocated in the old generation in the last mutator period.
+ double last_mutator_period_old_allocation_rate() const;
protected:
virtual double last_marking_length_s() const { return _marking_times_s.last(); }
public:
G1AdaptiveIHOPControl(double ihop_percent,
+ G1OldGenAllocationTracker const* old_gen_alloc_tracker,
G1Predictions const* predictor,
size_t heap_reserve_percent, // The percentage of total heap capacity that should not be tapped into.
size_t heap_waste_percent); // The percentage of the free space in the heap that we think is not usable for allocation.
virtual size_t get_conc_mark_start_threshold();
- virtual void update_allocation_info(double allocation_time_s, size_t allocated_bytes, size_t additional_buffer_size);
+ virtual void update_allocation_info(double allocation_time_s, size_t additional_buffer_size);
virtual void update_marking_length(double marking_length_s);
virtual void print();
virtual void send_trace_event(G1NewTracer* tracer);
};
< prev index next >