< prev index next >

src/hotspot/share/cds/dumpAllocStats.cpp

Print this page

  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #include "precompiled.hpp"
 26 #include "cds/aotClassLinker.hpp"

 27 #include "cds/dumpAllocStats.hpp"
 28 #include "logging/log.hpp"
 29 #include "logging/logMessage.hpp"
 30 
 31 void DumpAllocStats::print_stats(int ro_all, int rw_all) {
 32   // symbols
 33   _counts[RO][SymbolHashentryType] = _symbol_stats.hashentry_count;
 34   _bytes [RO][SymbolHashentryType] = _symbol_stats.hashentry_bytes;
 35 
 36   _counts[RO][SymbolBucketType] = _symbol_stats.bucket_count;
 37   _bytes [RO][SymbolBucketType] = _symbol_stats.bucket_bytes;
 38 
 39   // strings
 40   _counts[RO][StringHashentryType] = _string_stats.hashentry_count;
 41   _bytes [RO][StringHashentryType] = _string_stats.hashentry_bytes;
 42 
 43   _counts[RO][StringBucketType] = _string_stats.bucket_count;
 44   _bytes [RO][StringBucketType] = _string_stats.bucket_bytes;
 45 
 46   int all_ro_count = 0;

104 #undef fmt_stats
105 
106   msg.info("Class  CP entries = %6d, archived = %6d (%5.1f%%), reverted = %6d",
107            _num_klass_cp_entries, _num_klass_cp_entries_archived,
108            percent_of(_num_klass_cp_entries_archived, _num_klass_cp_entries),
109            _num_klass_cp_entries_reverted);
110   msg.info("Field  CP entries = %6d, archived = %6d (%5.1f%%), reverted = %6d",
111            _num_field_cp_entries, _num_field_cp_entries_archived,
112            percent_of(_num_field_cp_entries_archived, _num_field_cp_entries),
113            _num_field_cp_entries_reverted);
114   msg.info("Method CP entries = %6d, archived = %6d (%5.1f%%), reverted = %6d",
115            _num_method_cp_entries, _num_method_cp_entries_archived,
116            percent_of(_num_method_cp_entries_archived, _num_method_cp_entries),
117            _num_method_cp_entries_reverted);
118   msg.info("Indy   CP entries = %6d, archived = %6d (%5.1f%%), reverted = %6d",
119            _num_indy_cp_entries, _num_indy_cp_entries_archived,
120            percent_of(_num_indy_cp_entries_archived, _num_indy_cp_entries),
121            _num_indy_cp_entries_reverted);
122   msg.info("Platform loader initiated classes = %5d", AOTClassLinker::num_platform_initiated_classes());
123   msg.info("App      loader initiated classes = %5d", AOTClassLinker::num_app_initiated_classes());


124 }
125 
126 #ifdef ASSERT
127 void DumpAllocStats::verify(int expected_byte_size, bool read_only) const {
128   int bytes = 0;
129   const int what = (int)(read_only ? RO : RW);
130   for (int type = 0; type < int(_number_of_types); type ++) {
131     bytes += _bytes[what][type];
132   }
133   assert(bytes == expected_byte_size, "counter mismatch (%s: %d vs %d)",
134          (read_only ? "RO" : "RW"), bytes, expected_byte_size);
135 }
136 #endif // ASSERT

  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #include "precompiled.hpp"
 26 #include "cds/aotClassLinker.hpp"
 27 #include "cds/cdsConfig.hpp"
 28 #include "cds/dumpAllocStats.hpp"
 29 #include "logging/log.hpp"
 30 #include "logging/logMessage.hpp"
 31 
 32 void DumpAllocStats::print_stats(int ro_all, int rw_all) {
 33   // symbols
 34   _counts[RO][SymbolHashentryType] = _symbol_stats.hashentry_count;
 35   _bytes [RO][SymbolHashentryType] = _symbol_stats.hashentry_bytes;
 36 
 37   _counts[RO][SymbolBucketType] = _symbol_stats.bucket_count;
 38   _bytes [RO][SymbolBucketType] = _symbol_stats.bucket_bytes;
 39 
 40   // strings
 41   _counts[RO][StringHashentryType] = _string_stats.hashentry_count;
 42   _bytes [RO][StringHashentryType] = _string_stats.hashentry_bytes;
 43 
 44   _counts[RO][StringBucketType] = _string_stats.bucket_count;
 45   _bytes [RO][StringBucketType] = _string_stats.bucket_bytes;
 46 
 47   int all_ro_count = 0;

105 #undef fmt_stats
106 
107   msg.info("Class  CP entries = %6d, archived = %6d (%5.1f%%), reverted = %6d",
108            _num_klass_cp_entries, _num_klass_cp_entries_archived,
109            percent_of(_num_klass_cp_entries_archived, _num_klass_cp_entries),
110            _num_klass_cp_entries_reverted);
111   msg.info("Field  CP entries = %6d, archived = %6d (%5.1f%%), reverted = %6d",
112            _num_field_cp_entries, _num_field_cp_entries_archived,
113            percent_of(_num_field_cp_entries_archived, _num_field_cp_entries),
114            _num_field_cp_entries_reverted);
115   msg.info("Method CP entries = %6d, archived = %6d (%5.1f%%), reverted = %6d",
116            _num_method_cp_entries, _num_method_cp_entries_archived,
117            percent_of(_num_method_cp_entries_archived, _num_method_cp_entries),
118            _num_method_cp_entries_reverted);
119   msg.info("Indy   CP entries = %6d, archived = %6d (%5.1f%%), reverted = %6d",
120            _num_indy_cp_entries, _num_indy_cp_entries_archived,
121            percent_of(_num_indy_cp_entries_archived, _num_indy_cp_entries),
122            _num_indy_cp_entries_reverted);
123   msg.info("Platform loader initiated classes = %5d", AOTClassLinker::num_platform_initiated_classes());
124   msg.info("App      loader initiated classes = %5d", AOTClassLinker::num_app_initiated_classes());
125   msg.info("Dynamic proxy classes             = %5d%s", _num_dynamic_proxy_classes,
126            CDSConfig::is_dumping_full_module_graph() ? "" : " (not archiving FMG)");
127 }
128 
129 #ifdef ASSERT
130 void DumpAllocStats::verify(int expected_byte_size, bool read_only) const {
131   int bytes = 0;
132   const int what = (int)(read_only ? RO : RW);
133   for (int type = 0; type < int(_number_of_types); type ++) {
134     bytes += _bytes[what][type];
135   }
136   assert(bytes == expected_byte_size, "counter mismatch (%s: %d vs %d)",
137          (read_only ? "RO" : "RW"), bytes, expected_byte_size);
138 }
139 #endif // ASSERT
< prev index next >