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// Snapshot pointer array iterator 3863N/A// The pointer array contains malloc-ed pointers 4064N/A // locate an existing reserved memory region that contains specified address, 4064N/A // or the reserved region just above this address, where the incoming 4064N/A // reserved region should be inserted. 4064N/A // following methods update virtual memory in the context 4064N/A // of 'current' position, which is properly positioned by 4064N/A // callers via locate method. 4064N/A // split a reserved region to create a new memory region with specified base and size 4068N/A // check integrity of records on current reserved memory region. 4068N/A // all committed regions that follow current reserved region, should all 4068N/A // belong to the reserved region. 4066N/A // arena memory record is a special case, which we have to compare 4066N/A // sequence number against its associated arena record. 4066N/A // if there is an associated arena record, it has to be previous 4066N/A // record because of sorting order (by address) - NMT generates a pseudo address 4066N/A // for arena's size record by offsetting arena's address, that guarantees 4066N/A // the order of arena record and it's size record. 4066N/A // Skip this arena memory record 4066N/A // - if the arena record is an allocation record, this early 4066N/A // size record must be leftover by previous arena, 4066N/A // and the last size record should have size = 0. 4066N/A // - if the arena record is a deallocation record, this 4066N/A // size record should be its cleanup record, which should 4066N/A // also have size = 0. In other world, arena alway reset 4066N/A // its size before gone (see Arena's destructor) 4066N/A "Arena size record ahead of allocation record");
4064N/A// collapse duplicated records. Eliminating duplicated records here, is much 4064N/A// cheaper than during promotion phase. However, it does have limitation - it 4064N/A// can only eliminate duplicated records within the generation, there are 4064N/A// still chances seeing duplicated records during promotion. 4064N/A// We want to use the record with higher sequence number, because it has 4064N/A// more accurate callsite pc. 4064N/A // get next record, but skip the duplicated records 3863N/A // the following two arrays contain records of all known lived memory blocks 3863N/A // live malloc-ed memory pointers 3863N/A // live virtual memory pointers 3863N/A // the lock to protect this snapshot 4168N/A // the number of instance classes 3863N/A // if we are running out of native memory 3863N/A // merge a per-thread memory recorder into staging area 3863N/A // promote staged data to snapshot 4064N/A // dump all virtual memory pointers in snapshot 4066N/A // copy sequenced pointer from src to dest 4066N/A // assign a sequenced pointer to non-sequenced pointer 3863N/A#
endif // SHARE_VM_SERVICES_MEM_SNAPSHOT_HPP