src/hotspot/share/services/memTracker.hpp
changeset 48865 53427ddce0a0
parent 47216 71c04702a3d5
child 48872 c7774afc93e3
equal deleted inserted replaced
48864:42a2dc52a4e9 48865:53427ddce0a0
     1 /*
     1 /*
     2  * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 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.
    61   static inline void record_virtual_memory_reserve(void* addr, size_t size, const NativeCallStack& stack,
    61   static inline void record_virtual_memory_reserve(void* addr, size_t size, const NativeCallStack& stack,
    62                        MEMFLAGS flag = mtNone) { }
    62                        MEMFLAGS flag = mtNone) { }
    63   static inline void record_virtual_memory_reserve_and_commit(void* addr, size_t size,
    63   static inline void record_virtual_memory_reserve_and_commit(void* addr, size_t size,
    64     const NativeCallStack& stack, MEMFLAGS flag = mtNone) { }
    64     const NativeCallStack& stack, MEMFLAGS flag = mtNone) { }
    65   static inline void record_virtual_memory_commit(void* addr, size_t size, const NativeCallStack& stack) { }
    65   static inline void record_virtual_memory_commit(void* addr, size_t size, const NativeCallStack& stack) { }
    66   static inline Tracker get_virtual_memory_uncommit_tracker() { return Tracker(); }
       
    67   static inline Tracker get_virtual_memory_release_tracker() { return Tracker(); }
       
    68   static inline void record_virtual_memory_type(void* addr, MEMFLAGS flag) { }
    66   static inline void record_virtual_memory_type(void* addr, MEMFLAGS flag) { }
    69   static inline void record_thread_stack(void* addr, size_t size) { }
    67   static inline void record_thread_stack(void* addr, size_t size) { }
    70   static inline void release_thread_stack(void* addr, size_t size) { }
    68   static inline void release_thread_stack(void* addr, size_t size) { }
    71 
    69 
    72   static void final_report(outputStream*) { }
    70   static void final_report(outputStream*) { }
   223     if (addr != NULL) {
   221     if (addr != NULL) {
   224       ThreadCritical tc;
   222       ThreadCritical tc;
   225       if (tracking_level() < NMT_summary) return;
   223       if (tracking_level() < NMT_summary) return;
   226       VirtualMemoryTracker::add_committed_region((address)addr, size, stack);
   224       VirtualMemoryTracker::add_committed_region((address)addr, size, stack);
   227     }
   225     }
   228   }
       
   229 
       
   230   static inline Tracker get_virtual_memory_uncommit_tracker() {
       
   231     assert(tracking_level() >= NMT_summary, "Check by caller");
       
   232     return Tracker(Tracker::uncommit);
       
   233   }
       
   234 
       
   235   static inline Tracker get_virtual_memory_release_tracker() {
       
   236     assert(tracking_level() >= NMT_summary, "Check by caller");
       
   237     return Tracker(Tracker::release);
       
   238   }
   226   }
   239 
   227 
   240   static inline void record_virtual_memory_type(void* addr, MEMFLAGS flag) {
   228   static inline void record_virtual_memory_type(void* addr, MEMFLAGS flag) {
   241     if (tracking_level() < NMT_summary) return;
   229     if (tracking_level() < NMT_summary) return;
   242     if (addr != NULL) {
   230     if (addr != NULL) {