Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/hotspot/share/services/virtualMemoryTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,15 +535,21 @@ class SnapshotThreadStackWalker : public VirtualMemoryWalker {
address committed_start;
size_t committed_size;
size_t stack_size = rgn->base() + rgn->size() - stack_bottom;
// Align the size to work with full pages (Alpine and AIX stack top is not page aligned)
size_t aligned_stack_size = align_up(stack_size, os::vm_page_size());

ReservedMemoryRegion* region = const_cast<ReservedMemoryRegion*>(rgn);
NativeCallStack ncs; // empty stack

RegionIterator itr(stack_bottom, stack_size);
RegionIterator itr(stack_bottom, aligned_stack_size);
DEBUG_ONLY(bool found_stack = false;)
while (itr.next_committed(committed_start, committed_size)) {
assert(committed_start != NULL, "Should not be null");
assert(committed_size > 0, "Should not be 0");
// unaligned stack_size case: correct the region to fit the actual stack_size
if (stack_bottom + stack_size < committed_start + committed_size) {
committed_size = stack_bottom + stack_size - committed_start;
}
region->add_committed_region(committed_start, committed_size, ncs);
DEBUG_ONLY(found_stack = true;)
}
Expand Down