src/os/windows/vm/os_windows.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/os/windows/vm/os_windows.cpp Tue Jun 4 09:59:30 2013
--- new/src/os/windows/vm/os_windows.cpp Tue Jun 4 09:59:29 2013
*** 2845,2855 ****
--- 2845,2855 ----
size_of_reserve, // size of Reserve
MEM_RESERVE,
PAGE_READWRITE);
// If reservation failed, return NULL
if (p_buf == NULL) return NULL;
! MemTracker::record_virtual_memory_reserve((address)p_buf, size_of_reserve, mtNone, CALLER_PC);
os::release_memory(p_buf, bytes + chunk_size);
// we still need to round up to a page boundary (in case we are using large pages)
// but not to a chunk boundary (in case InterleavingGranularity doesn't align with page size)
// instead we handle this in the bytes_to_rq computation below
*** 2911,2921 ****
--- 2911,2921 ----
size_t bytes_to_release = bytes - bytes_remaining;
// NMT has yet to record any individual blocks, so it
// need to create a dummy 'reserve' record to match
// the release.
MemTracker::record_virtual_memory_reserve((address)p_buf,
! bytes_to_release, mtNone, CALLER_PC);
os::release_memory(p_buf, bytes_to_release);
}
#ifdef ASSERT
if (should_inject_error) {
if (TracePageSizes && Verbose) {
*** 2931,2943 ****
--- 2931,2944 ----
count++;
}
// Although the memory is allocated individually, it is returned as one.
// NMT records it as one block.
address pc = CALLER_PC;
MemTracker::record_virtual_memory_reserve((address)p_buf, bytes, pc);
if ((flags & MEM_COMMIT) != 0) {
! MemTracker::record_virtual_memory_commit((address)p_buf, bytes, pc);
! MemTracker::record_virtual_memory_reserve_and_commit((address)p_buf, bytes, mtNone, pc);
+ } else {
+ MemTracker::record_virtual_memory_reserve((address)p_buf, bytes, mtNone, pc);
}
// made it this far, success
return p_buf;
}
*** 3124,3145 ****
--- 3125,3143 ----
// normal policy just allocate it all at once
DWORD flag = MEM_RESERVE | MEM_COMMIT | MEM_LARGE_PAGES;
char * res = (char *)VirtualAlloc(NULL, bytes, flag, prot);
if (res != NULL) {
address pc = CALLER_PC;
! MemTracker::record_virtual_memory_reserve_and_commit((address)res, bytes, mtNone, pc);
MemTracker::record_virtual_memory_commit((address)res, bytes, pc);
}
return res;
}
}
bool os::release_memory_special(char* base, size_t bytes) {
assert(base != NULL, "Sanity check");
// Memory allocated via reserve_memory_special() is committed
MemTracker::record_virtual_memory_uncommit((address)base, bytes);
return release_memory(base, bytes);
}
void os::print_statistics() {
}
src/os/windows/vm/os_windows.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File