--- old/src/os/windows/vm/perfMemory_windows.cpp 2013-05-13 16:34:04.451661000 -0400 +++ new/src/os/windows/vm/perfMemory_windows.cpp 2013-05-13 16:34:03.433762000 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2013, 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 @@ -1498,8 +1498,8 @@ (void)memset(mapAddress, '\0', size); // it does not go through os api, the operation has to record from here - MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC); - MemTracker::record_virtual_memory_type((address)mapAddress, mtInternal); + NMTTrackOp op(NMTTrackOp::ReserveOp); + op.execute_op((address)mapAddress, size, mtInternal, CURRENT_PC); return (char*) mapAddress; } @@ -1681,9 +1681,8 @@ } // it does not go through os api, the operation has to record from here - MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC); - MemTracker::record_virtual_memory_type((address)mapAddress, mtInternal); - + NMTTrackOp op(NMTTrackOp::ReserveOp); + op.execute_op((address)mapAddress, size, mtInternal, CURRENT_PC); *addrp = (char*)mapAddress; *sizep = size; @@ -1836,9 +1835,11 @@ return; } + // remove_file_mapping() does not go through os api, need to notify + // NMT from here, before actually released + NMTTrackOp op(NMTTrackOp::ReleaseOp); + op.execute_op((address)addr, bytes); remove_file_mapping(addr); - // it does not go through os api, the operation has to record from here - MemTracker::record_virtual_memory_release((address)addr, bytes); } char* PerfMemory::backing_store_filename() {