src/os/windows/vm/os_windows.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff src/os/windows/vm/os_windows.cpp
src/os/windows/vm/os_windows.cpp
Print this page
*** 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, 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
--- 2845,2857 ----
size_of_reserve, // size of Reserve
MEM_RESERVE,
PAGE_READWRITE);
// If reservation failed, return NULL
if (p_buf == NULL) return NULL;
! NMTTrackOp op(NMTTrackOp::ReserveOp);
! op.execute_op((address)p_buf, size_of_reserve, 0, 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
*** 2910,2921 ****
// Some memory was committed so release it.
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, CALLER_PC);
os::release_memory(p_buf, bytes_to_release);
}
#ifdef ASSERT
if (should_inject_error) {
if (TracePageSizes && Verbose) {
--- 2912,2924 ----
// Some memory was committed so release it.
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.
! NMTTrackOp res_op(NMTTrackOp::ReserveOp);
! res_op.execute_op((address)p_buf, bytes_to_release, 0, CALLER_PC);
!
os::release_memory(p_buf, bytes_to_release);
}
#ifdef ASSERT
if (should_inject_error) {
if (TracePageSizes && Verbose) {
*** 2930,2944 ****
next_alloc_addr += bytes_to_rq;
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);
! }
// made it this far, success
return p_buf;
}
--- 2933,2945 ----
next_alloc_addr += bytes_to_rq;
count++;
}
// Although the memory is allocated individually, it is returned as one.
// NMT records it as one block.
! NMTTrackOp ind_op(((flags & MEM_COMMIT) != 0) ?
! NMTTrackOp::ReserveAndCommitOp : NMTTrackOp::ReserveOp);
! ind_op.execute_op((address)p_buf, bytes, 0, CALLER_PC);
// made it this far, success
return p_buf;
}
*** 3123,3145 ****
} else {
// 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((address)res, bytes, 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() {
}
--- 3124,3143 ----
} else {
// 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) {
! NMTTrackOp op(NMTTrackOp::ReserveAndCommitOp);
! op.execute_op((address)res, bytes, 0, CALLER_PC);
}
return res;
}
}
bool os::release_memory_special(char* base, size_t bytes) {
assert(base != NULL, "Sanity check");
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