Less frequently used idle worker daemons memory based expirationLess frequently used idle worker daemons are expired when available system memory gets below a threshold.Expiration strategy is triggered both by memory sampling and when the build daemon is about to fork a new process, or a new worker daemon. It will attempt to free enough system memory to fit the new process below the threshold according to it's fork options.This implementation does an approximation on the amount of memory held by worker daemons, using their max heap setting instead of their committed memory. This will be fixed in subsequent changes.
Single ExecutorFactory.createScheduled() methodWe only need fixed-size single-threaded scheduled executors.Use such executors for build daemon gc health checks, expiration checksand memory sampling.gradle/performance#298
Refine memory sampling event publishingMerge MemoryStatusBroadcaster into MemoryManager Broadcast start/stop is now isolated in MemoryManagerDaemonHealthStats wait for one JVM memory event Strengthen tests around health loggingServices depend on ExecutorFactory to use ScheduledExecutorServices And stop them properly