equal
deleted
inserted
replaced
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 } |