hotspot/src/share/vm/gc_implementation/shared/gcUtil.hpp
author brutisso
Mon, 21 Nov 2011 07:47:34 +0100
changeset 11170 7663e46f3a54
parent 7397 5b173b4ca846
child 12626 042841456ce1
permissions -rw-r--r--
7110718: -XX:MarkSweepAlwaysCompactCount=0 crashes the JVM Summary: Interpret MarkSweepAlwaysCompactCount < 1 as never do full compaction Reviewed-by: ysr, tonyp, jmasa, johnc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
     2
 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4574
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4574
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4574
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GCUTIL_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#define SHARE_VM_GC_IMPLEMENTATION_SHARED_GCUTIL_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "memory/allocation.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "runtime/timer.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    30
#include "utilities/debug.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    31
#include "utilities/globalDefinitions.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    32
#include "utilities/ostream.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    33
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
// Catch-all file for utility classes
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
// A weighted average maintains a running, weighted average
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
// of some float value (templates would be handy here if we
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
// need different types).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
// The average is adaptive in that we smooth it for the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
// initial samples; we don't use the weight until we have
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
// enough samples for it to be meaningful.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
// This serves as our best estimate of a future unknown.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
class AdaptiveWeightedAverage : public CHeapObj {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  float            _average;        // The last computed average
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  unsigned         _sample_count;   // How often we've sampled this average
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  unsigned         _weight;         // The weight used to smooth the averages
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
                                    //   A higher weight favors the most
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
                                    //   recent data.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
 protected:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  float            _last_sample;    // The last value sampled.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  void  increment_count()       { _sample_count++;       }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  void  set_average(float avg)  { _average = avg;        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  // Helper function, computes an adaptive weighted average
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  // given a sample and the last average
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  float compute_adaptive_average(float new_sample, float average);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  // Input weight must be between 0 and 100
4574
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
    66
  AdaptiveWeightedAverage(unsigned weight, float avg = 0.0) :
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
    67
    _average(avg), _sample_count(0), _weight(weight), _last_sample(0.0) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
976
241230d48896 6723228: NUMA allocator: assert(lgrp_id != -1, "No lgrp_id set")
iveresov
parents: 1
diff changeset
    70
  void clear() {
241230d48896 6723228: NUMA allocator: assert(lgrp_id != -1, "No lgrp_id set")
iveresov
parents: 1
diff changeset
    71
    _average = 0;
241230d48896 6723228: NUMA allocator: assert(lgrp_id != -1, "No lgrp_id set")
iveresov
parents: 1
diff changeset
    72
    _sample_count = 0;
241230d48896 6723228: NUMA allocator: assert(lgrp_id != -1, "No lgrp_id set")
iveresov
parents: 1
diff changeset
    73
    _last_sample = 0;
241230d48896 6723228: NUMA allocator: assert(lgrp_id != -1, "No lgrp_id set")
iveresov
parents: 1
diff changeset
    74
  }
241230d48896 6723228: NUMA allocator: assert(lgrp_id != -1, "No lgrp_id set")
iveresov
parents: 1
diff changeset
    75
4574
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
    76
  // Useful for modifying static structures after startup.
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
    77
  void  modify(size_t avg, unsigned wt, bool force = false)  {
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
    78
    assert(force, "Are you sure you want to call this?");
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
    79
    _average = (float)avg;
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
    80
    _weight  = wt;
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
    81
  }
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
    82
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  // Accessors
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  float    average() const       { return _average;       }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  unsigned weight()  const       { return _weight;        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  unsigned count()   const       { return _sample_count;  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  float    last_sample() const   { return _last_sample; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  // Update data with a new sample.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  void sample(float new_sample);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  static inline float exp_avg(float avg, float sample,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
                               unsigned int weight) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
    assert(0 <= weight && weight <= 100, "weight must be a percent");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
    return (100.0F - weight) * avg / 100.0F + weight * sample / 100.0F;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  static inline size_t exp_avg(size_t avg, size_t sample,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
                               unsigned int weight) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
    // Convert to float and back to avoid integer overflow.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
    return (size_t)exp_avg((float)avg, (float)sample, weight);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  }
4574
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
   102
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
   103
  // Printing
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
   104
  void print_on(outputStream* st) const;
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
   105
  void print() const;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
// A weighted average that includes a deviation from the average,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
// some multiple of which is added to the average.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
// This serves as our best estimate of an upper bound on a future
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
// unknown.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
class AdaptivePaddedAverage : public AdaptiveWeightedAverage {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  float          _padded_avg;     // The last computed padded average
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
  float          _deviation;      // Running deviation from the average
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  unsigned       _padding;        // A multiple which, added to the average,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
                                  // gives us an upper bound guess.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
 protected:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  void set_padded_average(float avg)  { _padded_avg = avg;  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  void set_deviation(float dev)       { _deviation  = dev;  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
  AdaptivePaddedAverage() :
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
    AdaptiveWeightedAverage(0),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
    _padded_avg(0.0), _deviation(0.0), _padding(0) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  AdaptivePaddedAverage(unsigned weight, unsigned padding) :
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
    AdaptiveWeightedAverage(weight),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
    _padded_avg(0.0), _deviation(0.0), _padding(padding) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  // Placement support
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  void* operator new(size_t ignored, void* p) { return p; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  // Allocator
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
  void* operator new(size_t size) { return CHeapObj::operator new(size); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  // Accessor
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  float padded_average() const         { return _padded_avg; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  float deviation()      const         { return _deviation;  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  unsigned padding()     const         { return _padding;    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
976
241230d48896 6723228: NUMA allocator: assert(lgrp_id != -1, "No lgrp_id set")
iveresov
parents: 1
diff changeset
   144
  void clear() {
241230d48896 6723228: NUMA allocator: assert(lgrp_id != -1, "No lgrp_id set")
iveresov
parents: 1
diff changeset
   145
    AdaptiveWeightedAverage::clear();
241230d48896 6723228: NUMA allocator: assert(lgrp_id != -1, "No lgrp_id set")
iveresov
parents: 1
diff changeset
   146
    _padded_avg = 0;
241230d48896 6723228: NUMA allocator: assert(lgrp_id != -1, "No lgrp_id set")
iveresov
parents: 1
diff changeset
   147
    _deviation = 0;
241230d48896 6723228: NUMA allocator: assert(lgrp_id != -1, "No lgrp_id set")
iveresov
parents: 1
diff changeset
   148
  }
241230d48896 6723228: NUMA allocator: assert(lgrp_id != -1, "No lgrp_id set")
iveresov
parents: 1
diff changeset
   149
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
  // Override
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  void  sample(float new_sample);
4574
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
   152
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
   153
  // Printing
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
   154
  void print_on(outputStream* st) const;
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
   155
  void print() const;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
// A weighted average that includes a deviation from the average,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
// some multiple of which is added to the average.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
// This serves as our best estimate of an upper bound on a future
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
// unknown.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
// A special sort of padded average:  it doesn't update deviations
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
// if the sample is zero. The average is allowed to change. We're
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
// preventing the zero samples from drastically changing our padded
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
// average.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
class AdaptivePaddedNoZeroDevAverage : public AdaptivePaddedAverage {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
  AdaptivePaddedNoZeroDevAverage(unsigned weight, unsigned padding) :
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
    AdaptivePaddedAverage(weight, padding)  {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
  // Override
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
  void  sample(float new_sample);
4574
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
   173
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
   174
  // Printing
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
   175
  void print_on(outputStream* st) const;
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
   176
  void print() const;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
};
4574
b2d5b0975515 6631166: CMS: better heuristics when combatting fragmentation
ysr
parents: 1217
diff changeset
   178
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
// Use a least squares fit to a set of data to generate a linear
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
// equation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
//              y = intercept + slope * x
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
class LinearLeastSquareFit : public CHeapObj {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  double _sum_x;        // sum of all independent data points x
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
  double _sum_x_squared; // sum of all independent data points x**2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  double _sum_y;        // sum of all dependent data points y
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
  double _sum_xy;       // sum of all x * y.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
  double _intercept;     // constant term
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
  double _slope;        // slope
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
  // The weighted averages are not currently used but perhaps should
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
  // be used to get decaying averages.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
  AdaptiveWeightedAverage _mean_x; // weighted mean of independent variable
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  AdaptiveWeightedAverage _mean_y; // weighted mean of dependent variable
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
  LinearLeastSquareFit(unsigned weight);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
  void update(double x, double y);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
  double y(double x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
  double slope() { return _slope; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
  // Methods to decide if a change in the dependent variable will
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
  // achive a desired goal.  Note that these methods are not
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
  // complementary and both are needed.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
  bool decrement_will_decrease();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
  bool increment_will_decrease();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
class GCPauseTimer : StackObj {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
  elapsedTimer* _timer;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
  GCPauseTimer(elapsedTimer* timer) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
    _timer = timer;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
    _timer->stop();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
  ~GCPauseTimer() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
    _timer->start();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   218
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   219
#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GCUTIL_HPP