src/share/vm/runtime/perfMemory.cpp

Print this page


   1 /*
   2  * Copyright (c) 2001, 2008, 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  */
  24 
  25 # include "incls/_precompiled.incl"
  26 # include "incls/_perfMemory.cpp.incl"









  27 
  28 // Prefix of performance data file.
  29 const char               PERFDATA_NAME[] = "hsperfdata";
  30 
  31 // Add 1 for the '_' character between PERFDATA_NAME and pid. The '\0' terminating
  32 // character will be included in the sizeof(PERFDATA_NAME) operation.
  33 static const size_t PERFDATA_FILENAME_LEN = sizeof(PERFDATA_NAME) +
  34                                             UINT_CHARS + 1;
  35 
  36 char*                    PerfMemory::_start = NULL;
  37 char*                    PerfMemory::_end = NULL;
  38 char*                    PerfMemory::_top = NULL;
  39 size_t                   PerfMemory::_capacity = 0;
  40 jint                     PerfMemory::_initialized = false;
  41 PerfDataPrologue*        PerfMemory::_prologue = NULL;
  42 
  43 void perfMemory_init() {
  44 
  45   if (!UsePerfData) return;
  46 


   1 /*
   2  * Copyright (c) 2001, 2010, 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  */
  24 
  25 #include "precompiled.hpp"
  26 #include "memory/allocation.inline.hpp"
  27 #include "runtime/arguments.hpp"
  28 #include "runtime/java.hpp"
  29 #include "runtime/mutex.hpp"
  30 #include "runtime/mutexLocker.hpp"
  31 #include "runtime/os.hpp"
  32 #include "runtime/perfData.hpp"
  33 #include "runtime/perfMemory.hpp"
  34 #include "runtime/statSampler.hpp"
  35 #include "utilities/globalDefinitions.hpp"
  36 
  37 // Prefix of performance data file.
  38 const char               PERFDATA_NAME[] = "hsperfdata";
  39 
  40 // Add 1 for the '_' character between PERFDATA_NAME and pid. The '\0' terminating
  41 // character will be included in the sizeof(PERFDATA_NAME) operation.
  42 static const size_t PERFDATA_FILENAME_LEN = sizeof(PERFDATA_NAME) +
  43                                             UINT_CHARS + 1;
  44 
  45 char*                    PerfMemory::_start = NULL;
  46 char*                    PerfMemory::_end = NULL;
  47 char*                    PerfMemory::_top = NULL;
  48 size_t                   PerfMemory::_capacity = 0;
  49 jint                     PerfMemory::_initialized = false;
  50 PerfDataPrologue*        PerfMemory::_prologue = NULL;
  51 
  52 void perfMemory_init() {
  53 
  54   if (!UsePerfData) return;
  55