Reduce the memory usage of the ProtoLogToFile
The protolog in wm/am is generally less than 1kb after being writtem to ProtoOutputStream,
but 'new ProtoOutputStream()' will at least create a byte array of 8kb each time.
This will cause each log to occupy at least 7kb of useless memory.
When the log cached by 'ProtoLogToFile' reaches BUFFER_CAPACITY(1MB), it will occupy 70MB of memory.
This has a greater impact on some low-memory devices.
Bug: 271179026
Bug: 262244460
Merged-In: I368278df6f801b2b2b67974089d4a7f4147d91cc
Change-Id: I368278df6f801b2b2b67974089d4a7f4147d91cc
3 files changed