/* * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
// This class represents a snapshot of virtual memory at a given time. // The latest snapshot is saved in a static area. class VirtualMemorySnapshot : public ResourceObj { friendclass VirtualMemorySummary;
// Move virtual memory from one memory type to another. // Virtual memory can be reserved before it is associated with a memory type, and tagged // as 'unknown'. Once the memory is tagged, the virtual memory will be moved from 'unknown' // type to specified memory type. staticinlinevoid move_reserved_memory(MEMFLAGS from, MEMFLAGS to, size_t size) {
as_snapshot()->by_type(from)->release_memory(size);
as_snapshot()->by_type(to)->reserve_memory(size);
}
int compare_committed_region(const CommittedMemoryRegion&, const CommittedMemoryRegion&); class ReservedMemoryRegion : public VirtualMemoryRegion { private:
SortedLinkedList<CommittedMemoryRegion, compare_committed_region>
_committed_regions;
// move committed regions that higher than specified address to // the new region void move_committed_regions(address addr, ReservedMemoryRegion& rgn);
private: // The committed region contains the uncommitted region, subtract the uncommitted // region from this committed region bool remove_uncommitted_region(LinkedListNode<CommittedMemoryRegion>* node,
address addr, size_t sz);
int compare_reserved_region_base(const ReservedMemoryRegion& r1, const ReservedMemoryRegion& r2);
class VirtualMemoryWalker : public StackObj { public: virtualbool do_allocation_site(const ReservedMemoryRegion* rgn) { returnfalse; }
};
// Main class called from MemTracker to track virtual memory allocations, commits and releases. class VirtualMemoryTracker : AllStatic { friendclass VirtualMemoryTrackerTest; friendclass CommittedVirtualMemoryTest;
// Given an existing memory mapping registered with NMT, split the mapping in // two. The newly created two mappings will be registered under the call // stack and the memory flags of the original section. staticbool split_reserved_region(address addr, size_t size, size_t split);
// Walk virtual memory data structure for creating baseline, etc. staticbool walk_virtual_memory(VirtualMemoryWalker* walker);
// If p is contained within a known memory region, print information about it to the // given stream and return true; false otherwise. staticbool print_containing_region(constvoid* p, outputStream* st);
// Snapshot current thread stacks staticvoid snapshot_thread_stacks();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.