1821 // region specified by <address, size> will be inaccessible after 1822 // a call to this method. 1823 // 1824 // If the JVM chooses not to support the attachability feature, 1825 // this method should throw an UnsupportedOperation exception. 1826 // 1827 // This implementation utilizes named shared memory to detach 1828 // the indicated process's PerfData memory region from this 1829 // process's address space. 1830 // 1831 void PerfMemory::detach(char* addr, size_t bytes, TRAPS) { 1832 1833 assert(addr != 0, "address sanity check"); 1834 assert(bytes > 0, "capacity sanity check"); 1835 1836 if (PerfMemory::contains(addr) || PerfMemory::contains(addr + bytes - 1)) { 1837 // prevent accidental detachment of this process's PerfMemory region 1838 return; 1839 } 1840 1841 if (MemTracker::tracking_level() > NMT_minimal) { 1842 // it does not go through os api, the operation has to record from here 1843 Tracker tkr = MemTracker::get_virtual_memory_release_tracker(); 1844 remove_file_mapping(addr); 1845 tkr.record((address)addr, bytes); 1846 } else { 1847 remove_file_mapping(addr); 1848 } 1849 } | 1821 // region specified by <address, size> will be inaccessible after 1822 // a call to this method. 1823 // 1824 // If the JVM chooses not to support the attachability feature, 1825 // this method should throw an UnsupportedOperation exception. 1826 // 1827 // This implementation utilizes named shared memory to detach 1828 // the indicated process's PerfData memory region from this 1829 // process's address space. 1830 // 1831 void PerfMemory::detach(char* addr, size_t bytes, TRAPS) { 1832 1833 assert(addr != 0, "address sanity check"); 1834 assert(bytes > 0, "capacity sanity check"); 1835 1836 if (PerfMemory::contains(addr) || PerfMemory::contains(addr + bytes - 1)) { 1837 // prevent accidental detachment of this process's PerfMemory region 1838 return; 1839 } 1840 1841 remove_file_mapping(addr); 1842 1843 MemTracker::record_virtual_memory_release(addr, bytes); 1844 } |