diff options
| author | 2023-03-01 10:27:59 +0800 | |
|---|---|---|
| committer | 2023-03-03 01:16:24 +0000 | |
| commit | 4f44cf75ccc9cb9d251ae5e04e0124972bce9700 (patch) | |
| tree | 3a2a3ff8720af19b9160da6122502caa87f2d6f5 /api/api.go | |
| parent | 18493d6267b991ab8b50e6a9aaa30be2aa1d6b23 (diff) | |
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
Change-Id: I368278df6f801b2b2b67974089d4a7f4147d91cc
Diffstat (limited to 'api/api.go')
0 files changed, 0 insertions, 0 deletions