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

Commit 2247de80 authored by Eric Miao's avatar Eric Miao
Browse files

Do not report native memory metrics for isolated processes

Bug: 375101140
Bug: 375154337
Bug: 375106132
Flag: EXEMPT bugfix

We are not going to report native memory metrics for isolated processes
until they become significant, and thus there is no need to read aconfig
flags at all.

This will avoid the crashes in the bugs, while still keep using the flag
that's read-n-writeable. And also this avoids the need for a readonly
version of the same flag.

Change-Id: Ie1ef8e546e1edc546b1ff7ccc10b539586edbdbf
parent cb17867b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -7681,7 +7681,9 @@ public final class ActivityThread extends ClientTransactionHandler
        });

        // Register callback to report native memory metrics post GC cleanup
        if (Flags.reportPostgcMemoryMetricsReadonly() &&
        // Note: we do not report memory metrics of isolated processes unless
        // their native allocations become more significant
        if (!Process.isIsolated() && Flags.reportPostgcMemoryMetrics() &&
            com.android.libcore.readonly.Flags.postCleanupApis()) {
            VMRuntime.addPostCleanupCallback(new Runnable() {
                @Override public void run() {
+0 −9
Original line number Diff line number Diff line
@@ -8,12 +8,3 @@ flag {
     description: "Controls whether to report memory metrics post GC cleanup"
     bug: "331243037"
}

flag {
     namespace: "system_performance"
     name: "report_postgc_memory_metrics_readonly"
     is_exported: false
     description: "Controls whether to report memory metrics post GC cleanup (readonly)"
     bug: "331243037"
     is_fixed_read_only: true
}