Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

17
LINES

< > TinyBrain | #1006295 - regularGC - perform GC regularly (once a minute) - now installed automatically by VM

JavaX fragment (include)

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;

static int regularGC_countdown = -1;

static synchronized void regularGC() {
  if (!_inCore()) ret; // Now doing it in core
  if (regularGC_timer == null)
    regularGC_timer = doEvery_daemon(regularGC_interval, regularGC_firstDelay, f regularGC_doIt);
}

static void regularGC_doIt() {
  if (regularGC_countdown == 0) ret;
  else if (regularGC_countdown > 0) --regularGC_countdown;
  timedGCPlusDeadlockSolving();
}

download  show line numbers  debug dex   

Travelled to 3 computer(s): cfunsshuasjs, sawdedvomwva, tvejysmllsmz

No comments. add comment

Snippet ID: #1006295
Snippet name: regularGC - perform GC regularly (once a minute) - now installed automatically by VM
Eternal ID of this version: #1006295/9
Text MD5: 0906ea2477a6dafe18bf0e12a1d32c55
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-17 07:52:48
Source code size: 618 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 121 / 82
Version history: 8 change(s)
Referenced in: [show]