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
Loading
Please register or sign in to comment