libbinder: Don't link against libutilscallstack.
This library can be used for dumping stack backtraces, but it pulls in a number of dependent libraries that significantly add to the memory usage of a native process: virtual shared shared private private size RSS PSS clean dirty clean dirty swap swapPSS # object -------- -------- -------- -------- -------- -------- -------- -------- -------- ---- ------------------------------ 184 64 9 56 0 0 8 0 0 3 /system/lib64/libartbase.so 104 40 9 32 0 0 8 0 0 3 /system/lib64/libbacktrace.so 276 60 13 48 0 0 12 0 0 3 /system/lib64/libdexfile.so 156 28 5 24 0 0 4 0 0 3 /system/lib64/liblzma.so 332 128 36 96 0 0 32 0 0 3 /system/lib64/libunwindstack.so 28 20 8 12 0 0 8 0 0 3 /system/lib64/libutilscallstack.so 56 28 8 20 0 0 8 0 0 3 /system/lib64/libziparchive.so These add about 80kB of private dirty memory usage, mostly because of relocations and some r/w data. Some libraries also allocate data on the heap on initialization; the total savings appear to be about ~120kB. Java processes don't suffer from these issues, because we fork after relocation and initialization, and much of the data doesn't change after that; it becomes shared dirty instead of private dirty. The current cases where CallStack() is used in libbinder don't warrant increasing native process memory by this much, so remove them; it's trivial to add them locally for debugging. Bug: 112073665 Test: builds Change-Id: I74104b4a8228255fedb4e78b27e38e7cab53225b
Loading
Please register or sign in to comment