src/hotspot/share/classfile/classLoaderStats.cpp
author pliden
Mon, 14 May 2018 15:42:59 +0200
changeset 50102 454fa295105c
parent 49824 e242740a92b8
child 51444 3e5d28e6de32
permissions -rw-r--r--
8202976: Add C1 lea patching support for x86 Reviewed-by: kvn, neliasso
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25051
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
     1
/*
49824
e242740a92b8 8201556: Disallow reading oops in ClassLoaderData if unloading
coleenp
parents: 49401
diff changeset
     2
 * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
25051
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
     4
 *
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
     7
 * published by the Free Software Foundation.
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
     8
 *
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    13
 * accompanied this code).
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    14
 *
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    18
 *
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    21
 * questions.
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    22
 *
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    23
 */
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    24
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    25
#include "precompiled.hpp"
49824
e242740a92b8 8201556: Disallow reading oops in ClassLoaderData if unloading
coleenp
parents: 49401
diff changeset
    26
#include "classfile/classLoaderData.inline.hpp"
25051
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    27
#include "classfile/classLoaderStats.hpp"
29081
c61eb4914428 8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents: 25051
diff changeset
    28
#include "oops/oop.inline.hpp"
25051
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    29
#include "utilities/globalDefinitions.hpp"
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    30
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    31
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    32
class ClassStatsClosure : public KlassClosure {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    33
public:
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    34
  int _num_classes;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    35
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    36
  ClassStatsClosure() :
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    37
    _num_classes(0) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    38
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    39
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    40
  virtual void do_klass(Klass* k) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    41
    _num_classes++;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    42
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    43
};
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    44
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    45
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    46
void ClassLoaderStatsClosure::do_cld(ClassLoaderData* cld) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    47
  oop cl = cld->class_loader();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    48
  ClassLoaderStats* cls;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    49
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    50
  // The hashtable key is the ClassLoader oop since we want to account
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    51
  // for "real" classes and anonymous classes together
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    52
  ClassLoaderStats** cls_ptr = _stats->get(cl);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    53
  if (cls_ptr == NULL) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    54
    cls = new ClassLoaderStats();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    55
    _stats->put(cl, cls);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    56
    _total_loaders++;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    57
  } else {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    58
    cls = *cls_ptr;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    59
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    60
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    61
  if (!cld->is_anonymous()) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    62
    cls->_cld = cld;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    63
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    64
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    65
  cls->_class_loader = cl;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    66
  if (cl != NULL) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    67
    cls->_parent = java_lang_ClassLoader::parent(cl);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    68
    addEmptyParents(cls->_parent);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    69
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    70
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    71
  ClassStatsClosure csc;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    72
  cld->classes_do(&csc);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    73
  if(cld->is_anonymous()) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    74
    cls->_anon_classes_count += csc._num_classes;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    75
  } else {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    76
    cls->_classes_count = csc._num_classes;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    77
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    78
  _total_classes += csc._num_classes;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    79
49401
0c71baee49a7 8199431: Split up class Metaspace into a static and a non-static part
stuefe
parents: 47216
diff changeset
    80
  ClassLoaderMetaspace* ms = cld->metaspace_or_null();
25051
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    81
  if (ms != NULL) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    82
    if(cld->is_anonymous()) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    83
      cls->_anon_chunk_sz += ms->allocated_chunks_bytes();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    84
      cls->_anon_block_sz += ms->allocated_blocks_bytes();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    85
    } else {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    86
      cls->_chunk_sz = ms->allocated_chunks_bytes();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    87
      cls->_block_sz = ms->allocated_blocks_bytes();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    88
    }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    89
    _total_chunk_sz += ms->allocated_chunks_bytes();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    90
    _total_block_sz += ms->allocated_blocks_bytes();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    91
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    92
}
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    93
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    94
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    95
// Handles the difference in pointer width on 32 and 64 bit platforms
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    96
#ifdef _LP64
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    97
  #define SPACE "%8s"
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    98
#else
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    99
  #define SPACE "%s"
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   100
#endif
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   101
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   102
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   103
bool ClassLoaderStatsClosure::do_entry(oop const& key, ClassLoaderStats* const& cls) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   104
  Klass* class_loader_klass = (cls->_class_loader == NULL ? NULL : cls->_class_loader->klass());
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   105
  Klass* parent_klass = (cls->_parent == NULL ? NULL : cls->_parent->klass());
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   106
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   107
  _out->print(INTPTR_FORMAT "  " INTPTR_FORMAT "  " INTPTR_FORMAT "  " UINTX_FORMAT_W(6) "  " SIZE_FORMAT_W(8) "  " SIZE_FORMAT_W(8) "  ",
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   108
      p2i(class_loader_klass), p2i(parent_klass), p2i(cls->_cld),
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   109
      cls->_classes_count,
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   110
      cls->_chunk_sz, cls->_block_sz);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   111
  if (class_loader_klass != NULL) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   112
    _out->print("%s", class_loader_klass->external_name());
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   113
  } else {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   114
    _out->print("<boot class loader>");
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   115
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   116
  _out->cr();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   117
  if (cls->_anon_classes_count > 0) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   118
    _out->print_cr(SPACE SPACE SPACE "                                    " UINTX_FORMAT_W(6) "  " SIZE_FORMAT_W(8) "  " SIZE_FORMAT_W(8) "   + unsafe anonymous classes",
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   119
        "", "", "",
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   120
        cls->_anon_classes_count,
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   121
        cls->_anon_chunk_sz, cls->_anon_block_sz);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   122
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   123
  return true;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   124
}
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   125
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   126
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   127
void ClassLoaderStatsClosure::print() {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   128
  _out->print_cr("ClassLoader" SPACE " Parent" SPACE "      CLD*" SPACE "       Classes   ChunkSz   BlockSz  Type", "", "", "");
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   129
  _stats->iterate(this);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   130
  _out->print("Total = " UINTX_FORMAT_W(-6), _total_loaders);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   131
  _out->print(SPACE SPACE SPACE "                      ", "", "", "");
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   132
  _out->print_cr(UINTX_FORMAT_W(6) "  " SIZE_FORMAT_W(8) "  " SIZE_FORMAT_W(8) "  ",
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   133
      _total_classes,
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   134
      _total_chunk_sz,
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   135
      _total_block_sz);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   136
  _out->print_cr("ChunkSz: Total size of all allocated metaspace chunks");
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   137
  _out->print_cr("BlockSz: Total size of all allocated metaspace blocks (each chunk has several blocks)");
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   138
}
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   139
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   140
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   141
void ClassLoaderStatsClosure::addEmptyParents(oop cl) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   142
  while (cl != NULL && java_lang_ClassLoader::loader_data(cl) == NULL) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   143
    // This classloader has not loaded any classes
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   144
    ClassLoaderStats** cls_ptr = _stats->get(cl);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   145
    if (cls_ptr == NULL) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   146
      // It does not exist in our table - add it
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   147
      ClassLoaderStats* cls = new ClassLoaderStats();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   148
      cls->_class_loader = cl;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   149
      cls->_parent = java_lang_ClassLoader::parent(cl);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   150
      _stats->put(cl, cls);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   151
      _total_loaders++;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   152
    }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   153
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   154
    cl = java_lang_ClassLoader::parent(cl);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   155
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   156
}
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   157
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   158
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   159
void ClassLoaderStatsVMOperation::doit() {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   160
  ClassLoaderStatsClosure clsc (_out);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   161
  ClassLoaderDataGraph::cld_do(&clsc);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   162
  clsc.print();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   163
}
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   164
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   165
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   166
void ClassLoaderStatsDCmd::execute(DCmdSource source, TRAPS) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   167
  ClassLoaderStatsVMOperation op(output());
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   168
  VMThread::execute(&op);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   169
}