Skip to content

Commit

Permalink
Move statistics to cover all cases
Browse files Browse the repository at this point in the history
  • Loading branch information
kstefanj committed Sep 25, 2024
1 parent e8aa3ed commit 1e64e36
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hotspot/share/gc/z/zPageAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,9 @@ ZPage* ZPageAllocator::defragment_page(ZPage* page) {
ZPage* new_page = new ZPage(ZPageType::small, vmem, pmem);
map_page(new_page);

// Update statistics
ZStatInc(ZCounterDefragment);

return new_page;
}

Expand Down Expand Up @@ -834,7 +837,6 @@ void ZPageAllocator::free_pages(const ZArray<ZPage*>* pages) {

// Check if page needs to be remapped to avoid fragmentation
if (should_defragment(page)) {
ZStatInc(ZCounterDefragment);
to_recycle.push(defragment_page(_safe_recycle.register_and_clone_if_activated(page)));
} else {
to_recycle.push(_safe_recycle.register_and_clone_if_activated(page));
Expand Down

0 comments on commit 1e64e36

Please sign in to comment.