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

11
LINES

< > BotCompany Repo | #1006271 // fullGC - try to do so much GC that memory is returned to OS

JavaX fragment (include)

// We used to do it 5 times, but got convince once is enough
// to actually return excess memory to OS.
static int fullGC_count = 1;

svoid fullGC() {
  print("Before GC: " + getMemoryInfo());
  for i to fullGC_count: {
    gc();
    print("After GC " + (i+1) + "/" + fullGC_count + ": " + getMemoryInfo());
  }
}

Author comment

Began life as a copy of #1006270

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006271
Snippet name: fullGC - try to do so much GC that memory is returned to OS
Eternal ID of this version: #1006271/1
Text MD5: 84c534a298511706efb86f8d49fe802c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-26 20:13:20
Source code size: 323 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 437 / 447
Referenced in: [show references]