Reset buffer after stop protolog to file

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

Change-Id: If618dad902df3c7fc1b2a943fe550c7c34a2d65e
This commit is contained in:
haoyu.wang
2023-02-02 10:16:11 +08:00
committed by 浩宇王
parent d20bc58ae9
commit 0ae7f50d0f

View File

@@ -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.");