avoid force gc during load

This initializes the lastGcCheck to the current time so it won't force GC in the first 10 minutes, avoiding unnecessary GC during load.
This commit is contained in:
Eugene Yokota 2019-08-23 02:16:11 -04:00
parent cd00d0f801
commit fcd9dbf3dd
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ private[sbt] object GCUtil {
// as specified by system properties.
val defaultForceGarbageCollection: Boolean = true
val defaultMinForcegcInterval: Duration = 10.minutes
val lastGcCheck: AtomicLong = new AtomicLong(0L)
val lastGcCheck: AtomicLong = new AtomicLong(System.currentTimeMillis)
def forceGcWithInterval(minForcegcInterval: Duration, log: Logger): Unit = {
val now = System.currentTimeMillis