memBaseline.cpp revision 4574
4168N/A * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 3863N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3863N/A * This code is free software; you can redistribute it and/or modify it 3863N/A * under the terms of the GNU General Public License version 2 only, as 3863N/A * published by the Free Software Foundation. 3863N/A * This code is distributed in the hope that it will be useful, but WITHOUT 3863N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 3863N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 3863N/A * version 2 for more details (a copy is included in the LICENSE file that 3863N/A * You should have received a copy of the GNU General Public License version 3863N/A * 2 along with this work; if not, write to the Free Software Foundation, 3863N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 3863N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 3863N/A {
mtNone,
"Unknown"}
// It can happen when type tagging records are lagging 3863N/A// baseline malloc'd memory records, generate overall summary and summaries by 4066N/A // We do have anonymous arenas, they are either used as value objects, 4066N/A // which are embedded inside other objects, or used as stack objects. 4066N/A // see if arena memory record present 4066N/A "Arena records do not match");
3863N/A // substract used arena size to get size of arena chunk in free list 3863N/A // we really don't know how many chunks in free list, so just set to 4477N/A// check if there is a safepoint in progress, if so, block the thread 4478N/A // grab and drop the SR_lock to honor the safepoint protocol 3863N/A// baseline mmap'd memory records, generate overall summary and summaries by 3863N/A // we use the number of thread stack to count threads 3863N/A// baseline malloc'd memory by callsites, but only the callsites with memory allocation 4064N/A // initailize malloc callsite array 4064N/A // sort into callsite pc order. Details are aggregated by callsites 3863N/A // baseline memory that is totaled over 1 KB 4064N/A // restore to address order. Snapshot malloc data is maintained in memory 3863N/A// baseline mmap'd memory by callsites 4064N/A // initialize virtual memory map array 4064N/A // initialize virtual memory callsite array 4064N/A // consolidate virtual memory data 4064N/A // vm_ptr is coming in increasing base address order 4064N/A // consolidate reserved memory regions for virtual memory map. 4064N/A // The criteria for consolidation is: 4064N/A // 1. two adjacent reserved memory regions 4064N/A // 2. belong to the same memory type 4064N/A // 3. reserved from the same callsite 4064N/A // inserted reserved region, we need the pointer to the element in virtual 4064N/A // consolidate committed memory regions for virtual memory map 4064N/A // 1. two adjacent committed memory regions 4064N/A // 2. committed from the same callsite 4064N/A // sort it into callsite pc order. Details are aggregated by callsites 4064N/A // walk the array to consolidate record by pc 3863N/A// baseline a snapshot. If summary_only = false, memory usages aggregated by 3863N/A// callsites are also baselined. 4477N/A// The method call can be lengthy, especially when detail tracking info is 4477N/A// requested. So the method checks for safepoint explicitly. 3863N/A/* compare functions for sorting */ 3863N/A// sort snapshot malloc'd records in callsite pc order 3863N/A// sort baselined malloc'd records in size order 3863N/A// sort baselined malloc'd records in callsite pc order 3863N/A// sort baselined mmap'd records in size (reserved size) order 3863N/A// sort baselined mmap'd records in callsite pc order 3863N/A// sort snapshot malloc'd records in memory block address order