src/hotspot/share/services/memTracker.cpp
author stuefe
Tue, 24 Apr 2018 18:06:32 +0200
changeset 49980 57dd7b4ba338
parent 49480 d7df2dd501ce
child 50429 83aec1d357d4
permissions -rw-r--r--
8201572: Improve Metaspace Statistics Reviewed-by: adinn, zgu
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
     1
/*
49480
d7df2dd501ce 8199809: Don't include frame.inline.hpp and other.inline.hpp from .hpp files
coleenp
parents: 47914
diff changeset
     2
 * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
     4
 *
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
     7
 * published by the Free Software Foundation.
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
     8
 *
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    13
 * accompanied this code).
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    14
 *
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    18
 *
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    21
 * questions.
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    22
 *
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    23
 */
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    24
#include "precompiled.hpp"
47765
b7c7428eaab9 8189610: Reconcile jvm.h and all jvm_md.h between java.base and hotspot
coleenp
parents: 47216
diff changeset
    25
#include "jvm.h"
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    26
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    27
#include "runtime/mutex.hpp"
49480
d7df2dd501ce 8199809: Don't include frame.inline.hpp and other.inline.hpp from .hpp files
coleenp
parents: 47914
diff changeset
    28
#include "runtime/orderAccess.inline.hpp"
47914
564882d918d4 8190357: NMT: Include metadata information in NMT final report when PrintNMTStatistics is on
zgu
parents: 47765
diff changeset
    29
#include "runtime/vmThread.hpp"
564882d918d4 8190357: NMT: Include metadata information in NMT final report when PrintNMTStatistics is on
zgu
parents: 47765
diff changeset
    30
#include "runtime/vm_operations.hpp"
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    31
#include "services/memBaseline.hpp"
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    32
#include "services/memReporter.hpp"
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    33
#include "services/mallocTracker.inline.hpp"
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    34
#include "services/memTracker.hpp"
17838
89e464689cb1 8011064: Some tests have failed with SIGSEGV on arm-hflt on build b82
jprovino
parents: 17074
diff changeset
    35
#include "utilities/defaultStream.hpp"
47914
564882d918d4 8190357: NMT: Include metadata information in NMT final report when PrintNMTStatistics is on
zgu
parents: 47765
diff changeset
    36
#include "utilities/vmError.hpp"
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    37
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    38
#ifdef SOLARIS
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    39
  volatile bool NMT_stack_walkable = false;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    40
#else
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    41
  volatile bool NMT_stack_walkable = true;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    42
#endif
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    43
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    44
volatile NMT_TrackingLevel MemTracker::_tracking_level = NMT_unknown;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    45
NMT_TrackingLevel MemTracker::_cmdline_tracking_level = NMT_unknown;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    46
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    47
MemBaseline MemTracker::_baseline;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    48
Mutex*      MemTracker::_query_lock = NULL;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    49
bool MemTracker::_is_nmt_env_valid = true;
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    50
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    51
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    52
NMT_TrackingLevel MemTracker::init_tracking_level() {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    53
  NMT_TrackingLevel level = NMT_off;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    54
  char buf[64];
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    55
  jio_snprintf(buf, sizeof(buf), "NMT_LEVEL_%d", os::current_process_id());
30125
8ba6e8e367e9 8074895: os::getenv is inadequate
jmanson
parents: 29574
diff changeset
    56
  const char *nmt_option = ::getenv(buf);
8ba6e8e367e9 8074895: os::getenv is inadequate
jmanson
parents: 29574
diff changeset
    57
  if (nmt_option != NULL) {
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    58
    if (strcmp(nmt_option, "summary") == 0) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    59
      level = NMT_summary;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    60
    } else if (strcmp(nmt_option, "detail") == 0) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    61
      level = NMT_detail;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    62
    } else if (strcmp(nmt_option, "off") != 0) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    63
      // The option value is invalid
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    64
      _is_nmt_env_valid = false;
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    65
    }
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    66
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    67
    // Remove the environment variable to avoid leaking to child processes
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    68
    os::unsetenv(buf);
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    69
  }
13301
f6dd749390dd 7181986: NMT ON: Assertion failure when running jdi ExpiredRequestDeletionTest
zgu
parents: 13195
diff changeset
    70
26144
35e11b657728 8055007: NMT2: emptyStack missing in minimal build
zgu
parents: 25946
diff changeset
    71
  // Construct NativeCallStack::EMPTY_STACK. It may get constructed twice,
35e11b657728 8055007: NMT2: emptyStack missing in minimal build
zgu
parents: 25946
diff changeset
    72
  // but it is benign, the results are the same.
35e11b657728 8055007: NMT2: emptyStack missing in minimal build
zgu
parents: 25946
diff changeset
    73
  ::new ((void*)&NativeCallStack::EMPTY_STACK) NativeCallStack(0, false);
35e11b657728 8055007: NMT2: emptyStack missing in minimal build
zgu
parents: 25946
diff changeset
    74
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    75
  if (!MallocTracker::initialize(level) ||
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    76
      !VirtualMemoryTracker::initialize(level)) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    77
    level = NMT_off;
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    78
  }
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    79
  return level;
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    80
}
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    81
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    82
void MemTracker::init() {
26136
254c226e4402 8054368: nsk/jdi/VirtualMachine/exit/exit002 crash with detail tracking on (NMT2)
zgu
parents: 25946
diff changeset
    83
  NMT_TrackingLevel level = tracking_level();
254c226e4402 8054368: nsk/jdi/VirtualMachine/exit/exit002 crash with detail tracking on (NMT2)
zgu
parents: 25946
diff changeset
    84
  if (level >= NMT_summary) {
254c226e4402 8054368: nsk/jdi/VirtualMachine/exit/exit002 crash with detail tracking on (NMT2)
zgu
parents: 25946
diff changeset
    85
    if (!VirtualMemoryTracker::late_initialize(level)) {
254c226e4402 8054368: nsk/jdi/VirtualMachine/exit/exit002 crash with detail tracking on (NMT2)
zgu
parents: 25946
diff changeset
    86
      shutdown();
254c226e4402 8054368: nsk/jdi/VirtualMachine/exit/exit002 crash with detail tracking on (NMT2)
zgu
parents: 25946
diff changeset
    87
      return;
254c226e4402 8054368: nsk/jdi/VirtualMachine/exit/exit002 crash with detail tracking on (NMT2)
zgu
parents: 25946
diff changeset
    88
    }
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    89
    _query_lock = new (std::nothrow) Mutex(Monitor::max_nonleaf, "NMT_queryLock");
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    90
    // Already OOM. It is unlikely, but still have to handle it.
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    91
    if (_query_lock == NULL) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    92
      shutdown();
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    93
    }
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    94
  }
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    95
}
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
    96
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    97
bool MemTracker::check_launcher_nmt_support(const char* value) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    98
  if (strcmp(value, "=detail") == 0) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
    99
    if (MemTracker::tracking_level() != NMT_detail) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   100
      return false;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   101
    }
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   102
  } else if (strcmp(value, "=summary") == 0) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   103
    if (MemTracker::tracking_level() != NMT_summary) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   104
      return false;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   105
    }
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   106
  } else if (strcmp(value, "=off") == 0) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   107
    if (MemTracker::tracking_level() != NMT_off) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   108
      return false;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   109
    }
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   110
  } else {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   111
    _is_nmt_env_valid = false;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   112
  }
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   113
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   114
  return true;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   115
}
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   116
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   117
bool MemTracker::verify_nmt_option() {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   118
  return _is_nmt_env_valid;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   119
}
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   120
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   121
void* MemTracker::malloc_base(void* memblock) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   122
  return MallocTracker::get_base(memblock);
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   123
}
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   124
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   125
void Tracker::record(address addr, size_t size) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   126
  if (MemTracker::tracking_level() < NMT_summary) return;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   127
  switch(_type) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   128
    case uncommit:
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   129
      VirtualMemoryTracker::remove_uncommitted_region(addr, size);
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   130
      break;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   131
    case release:
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   132
      VirtualMemoryTracker::remove_released_region(addr, size);
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   133
        break;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   134
    default:
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   135
      ShouldNotReachHere();
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   136
  }
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   137
}
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   138
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   139
27162
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   140
// Shutdown can only be issued via JCmd, and NMT JCmd is serialized by lock
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   141
void MemTracker::shutdown() {
27162
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   142
  // We can only shutdown NMT to minimal tracking level if it is ever on.
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   143
  if (tracking_level () > NMT_minimal) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   144
    transition_to(NMT_minimal);
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   145
  }
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   146
}
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   147
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   148
bool MemTracker::transition_to(NMT_TrackingLevel level) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   149
  NMT_TrackingLevel current_level = tracking_level();
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   150
27162
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   151
  assert(level != NMT_off || current_level == NMT_off, "Cannot transition NMT to off");
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   152
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   153
  if (current_level == level) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   154
    return true;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   155
  } else if (current_level > level) {
27162
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   156
    // Downgrade tracking level, we want to lower the tracking level first
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   157
    _tracking_level = level;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   158
    // Make _tracking_level visible immediately.
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   159
    OrderAccess::fence();
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   160
    VirtualMemoryTracker::transition(current_level, level);
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   161
    MallocTracker::transition(current_level, level);
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   162
  } else {
27162
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   163
    // Upgrading tracking level is not supported and has never been supported.
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   164
    // Allocating and deallocating malloc tracking structures is not thread safe and
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   165
    // leads to inconsistencies unless a lot coarser locks are added.
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   166
  }
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   167
  return true;
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   168
}
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   169
27162
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   170
void MemTracker::report(bool summary_only, outputStream* output) {
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   171
 assert(output != NULL, "No output stream");
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   172
  MemBaseline baseline;
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   173
  if (baseline.baseline(summary_only)) {
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   174
    if (summary_only) {
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   175
      MemSummaryReporter rpt(baseline, output);
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   176
      rpt.report();
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   177
    } else {
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   178
      MemDetailReporter rpt(baseline, output);
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   179
      rpt.report();
49980
57dd7b4ba338 8201572: Improve Metaspace Statistics
stuefe
parents: 49480
diff changeset
   180
      output->print("Metaspace:");
47914
564882d918d4 8190357: NMT: Include metadata information in NMT final report when PrintNMTStatistics is on
zgu
parents: 47765
diff changeset
   181
      // Metadata reporting requires a safepoint, so avoid it if VM is not in good state.
564882d918d4 8190357: NMT: Include metadata information in NMT final report when PrintNMTStatistics is on
zgu
parents: 47765
diff changeset
   182
      assert(!VMError::fatal_error_in_progress(), "Do not report metadata in error report");
49980
57dd7b4ba338 8201572: Improve Metaspace Statistics
stuefe
parents: 49480
diff changeset
   183
      VM_PrintMetadata vmop(output, K,
57dd7b4ba338 8201572: Improve Metaspace Statistics
stuefe
parents: 49480
diff changeset
   184
          MetaspaceUtils::rf_show_loaders |
57dd7b4ba338 8201572: Improve Metaspace Statistics
stuefe
parents: 49480
diff changeset
   185
          MetaspaceUtils::rf_break_down_by_spacetype);
47914
564882d918d4 8190357: NMT: Include metadata information in NMT final report when PrintNMTStatistics is on
zgu
parents: 47765
diff changeset
   186
      VMThread::execute(&vmop);
27162
0a4a7276949b 8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
coleenp
parents: 26145
diff changeset
   187
    }
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   188
  }
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   189
}
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   190
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   191
// This is a walker to gather malloc site hashtable statistics,
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   192
// the result is used for tuning.
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   193
class StatisticsWalker : public MallocSiteWalker {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   194
 private:
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   195
  enum Threshold {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   196
    // aggregates statistics over this threshold into one
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   197
    // line item.
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   198
    report_threshold = 20
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   199
  };
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   200
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   201
 private:
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   202
  // Number of allocation sites that have all memory freed
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   203
  int   _empty_entries;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   204
  // Total number of allocation sites, include empty sites
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   205
  int   _total_entries;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   206
  // Number of captured call stack distribution
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   207
  int   _stack_depth_distribution[NMT_TrackingStackDepth];
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   208
  // Hash distribution
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   209
  int   _hash_distribution[report_threshold];
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   210
  // Number of hash buckets that have entries over the threshold
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   211
  int   _bucket_over_threshold;
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   212
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   213
  // The hash bucket that walker is currently walking
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   214
  int   _current_hash_bucket;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   215
  // The length of current hash bucket
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   216
  int   _current_bucket_length;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   217
  // Number of hash buckets that are not empty
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   218
  int   _used_buckets;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   219
  // Longest hash bucket length
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   220
  int   _longest_bucket_length;
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   221
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   222
 public:
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   223
  StatisticsWalker() : _empty_entries(0), _total_entries(0) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   224
    int index = 0;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   225
    for (index = 0; index < NMT_TrackingStackDepth; index ++) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   226
      _stack_depth_distribution[index] = 0;
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   227
    }
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   228
    for (index = 0; index < report_threshold; index ++) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   229
      _hash_distribution[index] = 0;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   230
    }
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   231
    _bucket_over_threshold = 0;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   232
    _longest_bucket_length = 0;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   233
    _current_hash_bucket = -1;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   234
    _current_bucket_length = 0;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   235
    _used_buckets = 0;
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   236
  }
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   237
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   238
  virtual bool do_malloc_site(const MallocSite* e) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   239
    if (e->size() == 0) _empty_entries ++;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   240
    _total_entries ++;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   241
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   242
    // stack depth distrubution
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   243
    int frames = e->call_stack()->frames();
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   244
    _stack_depth_distribution[frames - 1] ++;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   245
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   246
    // hash distribution
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   247
    int hash_bucket = e->hash() % MallocSiteTable::hash_buckets();
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   248
    if (_current_hash_bucket == -1) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   249
      _current_hash_bucket = hash_bucket;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   250
      _current_bucket_length = 1;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   251
    } else if (_current_hash_bucket == hash_bucket) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   252
      _current_bucket_length ++;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   253
    } else {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   254
      record_bucket_length(_current_bucket_length);
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   255
      _current_hash_bucket = hash_bucket;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   256
      _current_bucket_length = 1;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   257
    }
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   258
    return true;
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   259
  }
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   260
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   261
  // walk completed
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   262
  void completed() {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   263
    record_bucket_length(_current_bucket_length);
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   264
  }
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   265
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   266
  void report_statistics(outputStream* out) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   267
    int index;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   268
    out->print_cr("Malloc allocation site table:");
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   269
    out->print_cr("\tTotal entries: %d", _total_entries);
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   270
    out->print_cr("\tEmpty entries: %d (%2.2f%%)", _empty_entries, ((float)_empty_entries * 100) / _total_entries);
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   271
    out->print_cr(" ");
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   272
    out->print_cr("Hash distribution:");
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   273
    if (_used_buckets < MallocSiteTable::hash_buckets()) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   274
      out->print_cr("empty bucket: %d", (MallocSiteTable::hash_buckets() - _used_buckets));
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   275
    }
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   276
    for (index = 0; index < report_threshold; index ++) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   277
      if (_hash_distribution[index] != 0) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   278
        if (index == 0) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   279
          out->print_cr("  %d    entry: %d", 1, _hash_distribution[0]);
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   280
        } else if (index < 9) { // single digit
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   281
          out->print_cr("  %d  entries: %d", (index + 1), _hash_distribution[index]);
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   282
        } else {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   283
          out->print_cr(" %d entries: %d", (index + 1), _hash_distribution[index]);
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   284
        }
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   285
      }
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   286
    }
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   287
    if (_bucket_over_threshold > 0) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   288
      out->print_cr(" >%d entries: %d", report_threshold,  _bucket_over_threshold);
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   289
    }
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   290
    out->print_cr("most entries: %d", _longest_bucket_length);
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   291
    out->print_cr(" ");
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   292
    out->print_cr("Call stack depth distribution:");
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   293
    for (index = 0; index < NMT_TrackingStackDepth; index ++) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   294
      if (_stack_depth_distribution[index] > 0) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   295
        out->print_cr("\t%d: %d", index + 1, _stack_depth_distribution[index]);
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   296
      }
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   297
    }
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   298
  }
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   299
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   300
 private:
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   301
  void record_bucket_length(int length) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   302
    _used_buckets ++;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   303
    if (length <= report_threshold) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   304
      _hash_distribution[length - 1] ++;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   305
    } else {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   306
      _bucket_over_threshold ++;
13300
38485c548c9f 7182543: NMT ON: Aggregate a few NMT related bugs
zgu
parents: 13195
diff changeset
   307
    }
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   308
    _longest_bucket_length = MAX2(_longest_bucket_length, length);
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   309
  }
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   310
};
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents:
diff changeset
   311
18086
f44cf213a775 8013651: NMT: reserve/release sequence id's in incorrect order due to race
zgu
parents: 17838
diff changeset
   312
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   313
void MemTracker::tuning_statistics(outputStream* out) {
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   314
  // NMT statistics
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   315
  StatisticsWalker walker;
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   316
  MallocSiteTable::walk_malloc_site(&walker);
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   317
  walker.completed();
18086
f44cf213a775 8013651: NMT: reserve/release sequence id's in incorrect order due to race
zgu
parents: 17838
diff changeset
   318
25946
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   319
  out->print_cr("Native Memory Tracking Statistics:");
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   320
  out->print_cr("Malloc allocation site table size: %d", MallocSiteTable::hash_buckets());
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   321
  out->print_cr("             Tracking stack depth: %d", NMT_TrackingStackDepth);
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   322
  NOT_PRODUCT(out->print_cr("Peak concurrent access: %d", MallocSiteTable::access_peak_count());)
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   323
  out->print_cr(" ");
1572c9f03fb9 8046598: Scalable Native memory tracking development
zgu
parents: 25351
diff changeset
   324
  walker.report_statistics(out);
18086
f44cf213a775 8013651: NMT: reserve/release sequence id's in incorrect order due to race
zgu
parents: 17838
diff changeset
   325
}