frameworks/base: Increased Zygote preload GC threshold to half the heap size
Zygote process preloads classes and resources while preparing the heap for all the processes. Garbage Collection is done in this preload loop to make the heap copy good before the heap is copied to the other processes. This Garbage Collection is done inside the preload loops once a threshold (PRELOAD_GC_THRESHOLD) is reached. This threshold is hardcoded to be 50000 bytes - a very low value, resulting in Garbage being unnecessarily collected repeatedly while preloading classes and resources, contributing to boot time. Garbage is also collected after the preloading stage is completed, which makes the GC done inside preload loop redundant. This change increases the threshold to be dynamically set to half the heap size specified in the dalvik vm. This ensures the GC is normally skipped inside the preload loop while still invoking GC in corner cases where the heap usage might cross 50% in the preload stage. Change-Id: I3e9841c04c04cf06a3f1eaa1bed66fa83209c0cb
Loading
Please register or sign in to comment