src/share/vm/services/nmtDCmd.hpp

Wed, 27 Aug 2014 08:19:12 -0400

author
zgu
date
Wed, 27 Aug 2014 08:19:12 -0400
changeset 7074
833b0f92429a
parent 5047
31a4e55f8c9d
child 7535
7ae4e26cb1e0
permissions
-rw-r--r--

8046598: Scalable Native memory tracking development
Summary: Enhance scalability of native memory tracking
Reviewed-by: coleenp, ctornqvi, gtriantafill

     1 /*
     2  * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     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
     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  */
    25 #ifndef SHARE_VM_SERVICES_NMT_DCMD_HPP
    26 #define SHARE_VM_SERVICES_NMT_DCMD_HPP
    28 #if INCLUDE_NMT
    30 #include "services/diagnosticArgument.hpp"
    31 #include "services/diagnosticFramework.hpp"
    32 #include "services/memBaseline.hpp"
    33 #include "services/mallocTracker.hpp"
    35 /**
    36  * Native memory tracking DCmd implementation
    37  */
    38 class NMTDCmd: public DCmdWithParser {
    39  protected:
    40   DCmdArgument<bool>  _summary;
    41   DCmdArgument<bool>  _detail;
    42   DCmdArgument<bool>  _baseline;
    43   DCmdArgument<bool>  _summary_diff;
    44   DCmdArgument<bool>  _detail_diff;
    45   DCmdArgument<bool>  _shutdown;
    46   DCmdArgument<bool>  _statistics;
    47   DCmdArgument<char*> _scale;
    49  public:
    50   NMTDCmd(outputStream* output, bool heap);
    51   static const char* name() { return "VM.native_memory"; }
    52   static const char* description() {
    53     return "Print native memory usage";
    54   }
    55   static const char* impact() {
    56     return "Medium";
    57   }
    58   static const JavaPermission permission() {
    59     JavaPermission p = {"java.lang.management.ManagementPermission",
    60                         "monitor", NULL};
    61     return p;
    62   }
    63   static int num_arguments();
    64   virtual void execute(DCmdSource source, TRAPS);
    66  private:
    67   void report(bool summaryOnly, size_t scale);
    68   void report_diff(bool summaryOnly, size_t scale);
    70   size_t get_scale(const char* scale) const;
    72   // check if NMT running at detail tracking level
    73   bool check_detail_tracking_level(outputStream* out);
    74 };
    76 #endif // INCLUDE_NMT
    78 #endif // SHARE_VM_SERVICES_NMT_DCMD_HPP

mercurial