src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.hpp
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 37985 hotspot/src/share/vm/gc/g1/g1YoungRemSetSamplingThread.hpp@539c597ee0fa
child 52918 f94c7929a44b
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33608
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
     1
/*
36378
d63bca5c1439 8140600: Convert unnecessarily malloc'd Monitors to value members
drwhite
parents: 35191
diff changeset
     2
 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
33608
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
     4
 *
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
     7
 * published by the Free Software Foundation.
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
     8
 *
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    13
 * accompanied this code).
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    14
 *
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    18
 *
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    21
 * questions.
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    22
 *
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    23
 */
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    24
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    25
#ifndef SHARE_VM_GC_G1_G1YOUNGREMSETSAMPLINGTHREAD_HPP
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    26
#define SHARE_VM_GC_G1_G1YOUNGREMSETSAMPLINGTHREAD_HPP
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    27
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    28
#include "gc/shared/concurrentGCThread.hpp"
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    29
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    30
// The G1YoungRemSetSamplingThread is used to re-assess the validity of
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    31
// the prediction for the remembered set lengths of the young generation.
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    32
//
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    33
// At the end of the GC G1 determines the length of the young gen based on
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    34
// how much time the next GC can take, and when the next GC may occur
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    35
// according to the MMU.
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    36
//
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    37
// The assumption is that a significant part of the GC is spent on scanning
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    38
// the remembered sets (and many other components), so this thread constantly
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    39
// reevaluates the prediction for the remembered set scanning costs, and potentially
37985
539c597ee0fa 8154154: Separate G1 specific policy code from the CollectorPolicy class hierarchy
mgerdin
parents: 37081
diff changeset
    40
// G1Policy resizes the young gen. This may do a premature GC or even
33608
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    41
// increase the young gen size to keep pause time length goal.
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    42
class G1YoungRemSetSamplingThread: public ConcurrentGCThread {
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    43
private:
36378
d63bca5c1439 8140600: Convert unnecessarily malloc'd Monitors to value members
drwhite
parents: 35191
diff changeset
    44
  Monitor _monitor;
33608
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    45
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    46
  void sample_young_list_rs_lengths();
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    47
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    48
  void run_service();
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    49
  void stop_service();
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    50
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    51
  void sleep_before_next_cycle();
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    52
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    53
  double _vtime_accum;  // Accumulated virtual time.
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    54
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    55
public:
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    56
  G1YoungRemSetSamplingThread();
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    57
  double vtime_accum() { return _vtime_accum; }
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    58
};
7afc768e4d62 8138920: Refactor the sampling thread from ConcurrentG1RefineThread
drwhite
parents:
diff changeset
    59
35191
da47979837b4 8145752: Fix include guards in GC code
tschatzl
parents: 33608
diff changeset
    60
#endif // SHARE_VM_GC_G1_G1YOUNGREMSETSAMPLINGTHREAD_HPP