Skip to content

Commit

Permalink
8261238: NMT should not limit baselining by size threshold
Browse files Browse the repository at this point in the history
Backport-of: 578a0b3
  • Loading branch information
tstuefe committed Jul 9, 2021
1 parent 591d769 commit 7bc4f40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/hotspot/share/services/memBaseline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ class MallocAllocationSiteWalker : public MallocSiteWalker {
}

bool do_malloc_site(const MallocSite* site) {
if (site->size() >= MemBaseline::SIZE_THRESHOLD) {
if (site->size() > 0) {
if (_malloc_sites.add(*site) != NULL) {
_count++;
return true;
} else {
return false; // OOM
}
} else {
// malloc site does not meet threshold, ignore and continue
// Ignore empty sites.
return true;
}
}
Expand All @@ -125,15 +125,17 @@ class VirtualMemoryAllocationWalker : public VirtualMemoryWalker {
VirtualMemoryAllocationWalker() : _count(0) { }

bool do_allocation_site(const ReservedMemoryRegion* rgn) {
if (rgn->size() >= MemBaseline::SIZE_THRESHOLD) {
if (rgn->size() > 0) {
if (_virtual_memory_regions.add(*rgn) != NULL) {
_count ++;
return true;
} else {
return false;
}
} else {
// Ignore empty sites.
return true;
}
return true;
}

LinkedList<ReservedMemoryRegion>* virtual_memory_allocations() {
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/share/services/memBaseline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ typedef LinkedListIterator<ReservedMemoryRegion> VirtualMemoryAllocation
*/
class MemBaseline {
public:
enum BaselineThreshold {
SIZE_THRESHOLD = K // Only allocation size over this threshold will be baselined.
};

enum BaselineType {
Not_baselined,
Expand Down

1 comment on commit 7bc4f40

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.