gcCause.cpp 3.1 KB
Newer Older
D
duke 已提交
1
/*
2
 * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
D
duke 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
 * 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.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
19 20 21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
D
duke 已提交
22 23 24
 *
 */

25 26
#include "precompiled.hpp"
#include "gc_interface/gcCause.hpp"
D
duke 已提交
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53

const char* GCCause::to_string(GCCause::Cause cause) {
  switch (cause) {
    case _java_lang_system_gc:
      return "System.gc()";

    case _full_gc_alot:
      return "FullGCAlot";

    case _scavenge_alot:
      return "ScavengeAlot";

    case _allocation_profiler:
      return "Allocation Profiler";

    case _jvmti_force_gc:
      return "JvmtiEnv ForceGarbageCollection";

    case _gc_locker:
      return "GCLocker Initiated GC";

    case _heap_inspection:
      return "Heap Inspection Initiated GC";

    case _heap_dump:
      return "Heap Dump Initiated GC";

54 55 56
    case _wb_young_gc:
      return "WhiteBox Initiated Young GC";

57 58 59
    case _wb_conc_mark:
      return "WhiteBox Initiated Concurrent Mark";

60 61
    case _update_allocation_context_stats_inc:
    case _update_allocation_context_stats_full:
62 63
      return "Update Allocation Context Stats";

64 65 66 67 68 69
    case _no_gc:
      return "No GC";

    case _allocation_failure:
      return "Allocation Failure";

D
duke 已提交
70 71 72
    case _tenured_generation_full:
      return "Tenured Generation Full";

73 74
    case _metadata_GC_threshold:
      return "Metadata GC Threshold";
D
duke 已提交
75 76 77 78 79 80 81 82 83 84

    case _cms_generation_full:
      return "CMS Generation Full";

    case _cms_initial_mark:
      return "CMS Initial Mark";

    case _cms_final_remark:
      return "CMS Final Remark";

S
sla 已提交
85 86 87
    case _cms_concurrent_mark:
      return "CMS Concurrent Mark";

D
duke 已提交
88 89 90 91 92 93
    case _old_generation_expanded_on_last_scavenge:
      return "Old Generation Expanded On Last Scavenge";

    case _old_generation_too_full_to_scavenge:
      return "Old Generation Too Full To Scavenge";

94 95 96
    case _adaptive_size_policy:
      return "Ergonomics";

97 98 99
    case _g1_inc_collection_pause:
      return "G1 Evacuation Pause";

100 101 102
    case _g1_humongous_allocation:
      return "G1 Humongous Allocation";

D
duke 已提交
103 104 105 106 107 108 109 110 111 112 113
    case _last_ditch_collection:
      return "Last ditch collection";

    case _last_gc_cause:
      return "ILLEGAL VALUE - last gc cause - ILLEGAL VALUE";

    default:
      return "unknown GCCause";
  }
  ShouldNotReachHere();
}