static int regularGC_interval = 60000; // every minute static int regularGC_firstDelay = 20000; // clean up 20 seconds after loading VM static volatile java.util.Timer regularGC_timer; sO regularGC_condition; // F0 - set this to make GC depend on a condition static int regularGC_countdown = -1; static void regularGC() { if (!_inCore()) ret with callJavaX('regularGC); lock generalLock(); if (regularGC_timer == null) regularGC_timer = doEvery_daemon(regularGC_interval, regularGC_firstDelay, r regularGC_doIt); } static void regularGC_doIt() { if (regularGC_countdown == 0) ret; else if (regularGC_countdown > 0) --regularGC_countdown; if (!isFalse(pcallF(regularGC_condition))) timedGCPlusDeadlockSolving(); else callOpt(javax(), 'cleanWeakMaps); // This is important, always do it }