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

Commit 5b99a6c4 authored by haoyu.wang's avatar haoyu.wang Committed by Hongwei Wang
Browse files

Reset buffer after stop protolog to file

After protolog-to-file stops, BaseProtoLogImpl.mBuffer still uses a lot of memory.

Bug: 262244460
Merged-In: If618dad902df3c7fc1b2a943fe550c7c34a2d65e
Change-Id: If618dad902df3c7fc1b2a943fe550c7c34a2d65e
parent b0479a10
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -255,6 +255,7 @@ public class BaseProtoLogImpl {
            if (writeToFile) {
            if (writeToFile) {
                writeProtoLogToFileLocked();
                writeProtoLogToFileLocked();
                logAndPrintln(pw, "Log written to " + mLogFile + ".");
                logAndPrintln(pw, "Log written to " + mLogFile + ".");
                mBuffer.resetBuffer();
            }
            }
            if (mProtoLogEnabled) {
            if (mProtoLogEnabled) {
                logAndPrintln(pw, "ERROR: logging was re-enabled while waiting for flush.");
                logAndPrintln(pw, "ERROR: logging was re-enabled while waiting for flush.");