Trigger fewer GCs during startup

Instead of explicitly triggering a GC after two seconds, gradually
reduce the GC triggering threshold. In particular, a small process
that almost immediately goes into the background should GC only
as part of the transition to background.

Ensure that the first collection is a full (technically "partial",
non-sticky) gc, that tries to collect everything but zygote space.
There should be very few allocated objects except in zygote space.

Clarify the concurrency rules for accessing concurrent_start_bytes_
in the process.

Test: Build and boot AOSP
Bug: 181351667
Change-Id: Id85d7e405b9305a70ba751a82ab7c2226eb83308
2 files changed