Mercurial > hg > truffle
comparison src/os/windows/vm/perfMemory_windows.cpp @ 12912:d840f02d03b4
Merge
author | chegar |
---|---|
date | Mon, 15 Jul 2013 11:07:03 +0100 |
parents | 1f4355cee9a2 |
children | 833b0f92429a |
comparison
equal
deleted
inserted
replaced
12911:5c599c419c1d | 12912:d840f02d03b4 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 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 | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
56 if (mapAddress == NULL) { | 56 if (mapAddress == NULL) { |
57 return NULL; | 57 return NULL; |
58 } | 58 } |
59 | 59 |
60 // commit memory | 60 // commit memory |
61 if (!os::commit_memory(mapAddress, size)) { | 61 if (!os::commit_memory(mapAddress, size, !ExecMem)) { |
62 if (PrintMiscellaneous && Verbose) { | 62 if (PrintMiscellaneous && Verbose) { |
63 warning("Could not commit PerfData memory\n"); | 63 warning("Could not commit PerfData memory\n"); |
64 } | 64 } |
65 os::release_memory(mapAddress, size); | 65 os::release_memory(mapAddress, size); |
66 return NULL; | 66 return NULL; |
1496 | 1496 |
1497 // clear the shared memory region | 1497 // clear the shared memory region |
1498 (void)memset(mapAddress, '\0', size); | 1498 (void)memset(mapAddress, '\0', size); |
1499 | 1499 |
1500 // it does not go through os api, the operation has to record from here | 1500 // it does not go through os api, the operation has to record from here |
1501 MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC); | 1501 MemTracker::record_virtual_memory_reserve((address)mapAddress, size, mtInternal, CURRENT_PC); |
1502 MemTracker::record_virtual_memory_type((address)mapAddress, mtInternal); | |
1503 | 1502 |
1504 return (char*) mapAddress; | 1503 return (char*) mapAddress; |
1505 } | 1504 } |
1506 | 1505 |
1507 // this method deletes the file mapping object. | 1506 // this method deletes the file mapping object. |
1679 THROW_MSG(vmSymbols::java_lang_OutOfMemoryError(), | 1678 THROW_MSG(vmSymbols::java_lang_OutOfMemoryError(), |
1680 "Could not map PerfMemory"); | 1679 "Could not map PerfMemory"); |
1681 } | 1680 } |
1682 | 1681 |
1683 // it does not go through os api, the operation has to record from here | 1682 // it does not go through os api, the operation has to record from here |
1684 MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC); | 1683 MemTracker::record_virtual_memory_reserve((address)mapAddress, size, mtInternal, CURRENT_PC); |
1685 MemTracker::record_virtual_memory_type((address)mapAddress, mtInternal); | |
1686 | 1684 |
1687 | 1685 |
1688 *addrp = (char*)mapAddress; | 1686 *addrp = (char*)mapAddress; |
1689 *sizep = size; | 1687 *sizep = size; |
1690 | 1688 |
1834 if (PerfMemory::contains(addr) || PerfMemory::contains(addr + bytes - 1)) { | 1832 if (PerfMemory::contains(addr) || PerfMemory::contains(addr + bytes - 1)) { |
1835 // prevent accidental detachment of this process's PerfMemory region | 1833 // prevent accidental detachment of this process's PerfMemory region |
1836 return; | 1834 return; |
1837 } | 1835 } |
1838 | 1836 |
1837 MemTracker::Tracker tkr = MemTracker::get_virtual_memory_release_tracker(); | |
1839 remove_file_mapping(addr); | 1838 remove_file_mapping(addr); |
1840 // it does not go through os api, the operation has to record from here | 1839 // it does not go through os api, the operation has to record from here |
1841 MemTracker::record_virtual_memory_release((address)addr, bytes); | 1840 tkr.record((address)addr, bytes); |
1842 } | 1841 } |
1843 | 1842 |
1844 char* PerfMemory::backing_store_filename() { | 1843 char* PerfMemory::backing_store_filename() { |
1845 return sharedmem_fileName; | 1844 return sharedmem_fileName; |
1846 } | 1845 } |