Skip to content

Commit

Permalink
Update obsolete code.
Browse files Browse the repository at this point in the history
`usedHeapSizePostBuild` was always 0 ever since d9a523e.

PiperOrigin-RevId: 462575294
Change-Id: I065d79501a6866541a030e1cc757ecd6040f4bc3
  • Loading branch information
joeleba authored and copybara-github committed Jul 22, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 6751724 commit 23c013d
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -249,7 +249,6 @@ private ActionSummary finishActionSummary() {

private MemoryMetrics createMemoryMetrics() {
MemoryMetrics.Builder memoryMetrics = MemoryMetrics.newBuilder();
long usedHeapSizePostBuild = 0;
if (MemoryProfiler.instance().getHeapUsedMemoryAtFinish() > 0) {
memoryMetrics.setUsedHeapSizePostBuild(MemoryProfiler.instance().getHeapUsedMemoryAtFinish());
}
@@ -258,10 +257,10 @@ private MemoryMetrics createMemoryMetrics() {
.map(PeakHeap::bytes)
.ifPresent(memoryMetrics::setPeakPostGcHeapSize);

if (memoryMetrics.getPeakPostGcHeapSize() < usedHeapSizePostBuild) {
if (memoryMetrics.getPeakPostGcHeapSize() < memoryMetrics.getUsedHeapSizePostBuild()) {
// If we just did a GC and computed the heap size, update the one we got from the GC
// notification (which may arrive too late for this specific GC).
memoryMetrics.setPeakPostGcHeapSize(usedHeapSizePostBuild);
memoryMetrics.setPeakPostGcHeapSize(memoryMetrics.getUsedHeapSizePostBuild());
}

PostGCMemoryUseRecorder.get()

0 comments on commit 23c013d

Please sign in to comment.