Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 774cfca4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add Java heap metrics to PostGCMemorySnapshot." into main

parents f03752c2 15216a59
Loading
Loading
Loading
Loading
+19 −14
Original line number Diff line number Diff line
@@ -16,16 +16,17 @@

package com.android.internal.os.logging;

import android.app.Application;
import android.os.Process;
import android.util.Log;
import android.view.WindowManager.LayoutParams;

import com.android.internal.os.ProcfsMemoryUtil;
import com.android.internal.util.FrameworkStatsLog;
import java.util.Collection;

import libcore.util.NativeAllocationRegistry;

import java.util.Collection;


/**
 * Used to wrap different logging calls in one, so that client side code base is clean and more
 * readable.
@@ -84,6 +85,7 @@ public class MetricsLoggerWrapper {

        ProcfsMemoryUtil.MemorySnapshot m = ProcfsMemoryUtil.readMemorySnapshotFromProcfs();
        int oom_score_adj = ProcfsMemoryUtil.readOomScoreAdjFromProcfs();
        Runtime runtime = Runtime.getRuntime();
        FrameworkStatsLog.write(FrameworkStatsLog.POSTGC_MEMORY_SNAPSHOT,
                m.uid, processName, pid,
                oom_score_adj,
@@ -95,6 +97,9 @@ public class MetricsLoggerWrapper {
                mallocedCount,
                mallocedBytes,
                nonmallocedCount,
            nonmallocedBytes);
                nonmallocedBytes,
                runtime.freeMemory(),
                runtime.totalMemory(),
                runtime.maxMemory());
    }
}