src/hotspot/share/services/memReporter.cpp
changeset 48884 7e17b00dc245
parent 48874 f09fdaad7321
child 49033 3acc342c0738
equal deleted inserted replaced
48883:0f1be3c7b6b2 48884:7e17b00dc245
     1 /*
     1 /*
     2  * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   143     print_total(reserved_amount, committed_amount);
   143     print_total(reserved_amount, committed_amount);
   144     out->print_cr(")");
   144     out->print_cr(")");
   145 
   145 
   146     if (flag == mtClass) {
   146     if (flag == mtClass) {
   147       // report class count
   147       // report class count
   148       out->print_cr("%27s (classes #" SIZE_FORMAT ")", " ", _class_count);
   148       out->print_cr("%27s (classes #" SIZE_FORMAT ")",
       
   149         " ", (_instance_class_count + _array_class_count));
       
   150       out->print_cr("%27s (  instance classes #" SIZE_FORMAT ", array classes #" SIZE_FORMAT ")",
       
   151         " ", _instance_class_count, _array_class_count);
   149     } else if (flag == mtThread) {
   152     } else if (flag == mtThread) {
   150       // report thread count
   153       // report thread count
   151       out->print_cr("%27s (thread #" SIZE_FORMAT ")", " ", _malloc_snapshot->thread_count());
   154       out->print_cr("%27s (thread #" SIZE_FORMAT ")", " ", _malloc_snapshot->thread_count());
   152       const VirtualMemory* thread_stack_usage =
   155       const VirtualMemory* thread_stack_usage =
   153        _vm_snapshot->by_type(mtThreadStack);
   156        _vm_snapshot->by_type(mtThreadStack);
   457         _early_baseline.class_count());
   460         _early_baseline.class_count());
   458       if (_current_baseline.class_count() != _early_baseline.class_count()) {
   461       if (_current_baseline.class_count() != _early_baseline.class_count()) {
   459         out->print(" %+d", (int)(_current_baseline.class_count() - _early_baseline.class_count()));
   462         out->print(" %+d", (int)(_current_baseline.class_count() - _early_baseline.class_count()));
   460       }
   463       }
   461       out->print_cr(")");
   464       out->print_cr(")");
       
   465 
       
   466       out->print("%27s (  instance classes #" SIZE_FORMAT, " ", _current_baseline.instance_class_count());
       
   467       if (_current_baseline.instance_class_count() != _early_baseline.instance_class_count()) {
       
   468         out->print(" %+d", (int)(_current_baseline.instance_class_count() - _early_baseline.instance_class_count()));
       
   469       }
       
   470       out->print(", array classes #" SIZE_FORMAT, _current_baseline.array_class_count());
       
   471       if (_current_baseline.array_class_count() != _early_baseline.array_class_count()) {
       
   472         out->print(" %+d", (int)(_current_baseline.array_class_count() - _early_baseline.array_class_count()));
       
   473       }
       
   474       out->print_cr(")");
       
   475 
   462     } else if (flag == mtThread) {
   476     } else if (flag == mtThread) {
   463       // report thread count
   477       // report thread count
   464       out->print("%27s (thread #" SIZE_FORMAT "", " ", _current_baseline.thread_count());
   478       out->print("%27s (thread #" SIZE_FORMAT "", " ", _current_baseline.thread_count());
   465       int thread_count_diff = (int)(_current_baseline.thread_count() -
   479       int thread_count_diff = (int)(_current_baseline.thread_count() -
   466           _early_baseline.thread_count());
   480           _early_baseline.thread_count());