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)

1  
// We used to do it 5 times, but got convince once is enough
2  
// to actually return excess memory to OS.
3  
static int fullGC_count = 1;
4  
5  
svoid fullGC() {
6  
  print("Before GC: " + getMemoryInfo());
7  
  for i to fullGC_count: {
8  
    gc();
9  
    print("After GC " + (i+1) + "/" + fullGC_count + ": " + getMemoryInfo());
10  
  }
11  
}

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: 439 / 451
Referenced in: [show references]