Reland "Trigger fewer GCs during startup""

This reverts commit da90ab4ebb233a0f38f7bb226892244c048ae275.

PS1 is identical to aosp/1653767 :

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.

PS2:
Adds code to explicitly trigger a GC if none has been triggered
in the first 30 seconds or so. For AOSP, this happens in seven
processes.

No longer condition any of this on the CC collector. I don't see
why that should matter.

Trigger the low-allocation GC above even in low memory mode. I think
we want to especially do it in that case. We were previously not doing
that, probably it was tied to increasing the heap size.

Test: Build and boot AOSP.
Test: Manual log inspection with extra logging.
Bug: 181351667
Bug: 197780496

Change-Id: I822224bef3e97c2ab1f803eafe97bcdd21b9cd4e
2 files changed