hotspot/src/share/vm/gc_interface/gcCause.hpp
author xdono
Tue, 28 Jul 2009 12:12:40 -0700
changeset 3261 c7d5aae8d3f7
parent 2344 f2e09ba7ceab
child 5547 f4b087cbb361
permissions -rw-r--r--
6862919: Update copyright year Summary: Update copyright for files that have been modified in 2009, up to 07/09 Reviewed-by: tbell, ohair
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
3261
c7d5aae8d3f7 6862919: Update copyright year
xdono
parents: 2344
diff changeset
     2
 * Copyright 2002-2009 Sun Microsystems, Inc.  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
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
 * have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
// This class exposes implementation details of the various
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
// collector(s), and we need to be very careful with it. If
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
// use of this class grows, we should split it into public
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
// and implemenation-private "causes".
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
class GCCause : public AllStatic {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
  enum Cause {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
    /* public */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
    _java_lang_system_gc,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
    _full_gc_alot,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
    _scavenge_alot,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
    _allocation_profiler,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
    _jvmti_force_gc,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
    _gc_locker,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
    _heap_inspection,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
    _heap_dump,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
    /* implementation independent, but reserved for GC use */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
    _no_gc,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
    _no_cause_specified,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
    _allocation_failure,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
    /* implementation specific */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
    _tenured_generation_full,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
    _permanent_generation_full,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
    _cms_generation_full,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
    _cms_initial_mark,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
    _cms_final_remark,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
    _old_generation_expanded_on_last_scavenge,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
    _old_generation_too_full_to_scavenge,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
    _adaptive_size_policy,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
2344
f2e09ba7ceab 6543938: G1: remove the concept of popularity
apetrusenko
parents: 1374
diff changeset
    63
    _g1_inc_collection_pause,
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 1
diff changeset
    64
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
    _last_ditch_collection,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
    _last_gc_cause
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  inline static bool is_user_requested_gc(GCCause::Cause cause) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
    return (cause == GCCause::_java_lang_system_gc ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
            cause == GCCause::_jvmti_force_gc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
  }
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 1
diff changeset
    73
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  inline static bool is_serviceability_requested_gc(GCCause::Cause
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
                                                             cause) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
    return (cause == GCCause::_jvmti_force_gc ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
            cause == GCCause::_heap_inspection ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
            cause == GCCause::_heap_dump);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  }
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 1
diff changeset
    80
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  // Return a string describing the GCCause.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  static const char* to_string(GCCause::Cause cause);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  // Return true if the GCCause is for a full collection.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  static bool is_for_full_collection(GCCause::Cause cause) PRODUCT_RETURN0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
};