Skip to content

Commit

Permalink
HeapImplMemoryMXBean set heapMaxSize value
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeCqupt committed Nov 2, 2022
1 parent 29e0911 commit eb00f7a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public HeapImplMemoryMXBean() {
public MemoryUsage getHeapMemoryUsage() {
long heapUsed = HeapImpl.getHeapImpl().getUsedBytes().rawValue();
long heapCommitted = HeapImpl.getHeapImpl().getCommittedBytes().rawValue();
return new MemoryUsage(UNDEFINED_MEMORY_USAGE, heapUsed, heapCommitted, UNDEFINED_MEMORY_USAGE);
long heapMax = GCImpl.getPolicy().getMaximumHeapSize().rawValue();
return new MemoryUsage(UNDEFINED_MEMORY_USAGE, heapUsed, heapCommitted, heapMax);
}
}

0 comments on commit eb00f7a

Please sign in to comment.