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

15
LINES

< > BotCompany Repo | #1016151 // Java Heap Percentage [Dyn Module]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (2942L/15K).

!7

cmodule JavaHeapPercentage > DynBigNumber {
  start {
    setDescription("Java heap used of " + toM(Runtime.getRuntime().maxMemory()) + " MB");
    doEveryAndNow(1000, r actualUpdate);
  }
  
  void actualUpdate {
    long max = Runtime.getRuntime().maxMemory();
    //long used = memoryUsedAfterLastGC();
    long used = usedMemory();
    setValue(iceil(doublePercentRatio(used, max)) + " %");
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1016151
Snippet name: Java Heap Percentage [Dyn Module]
Eternal ID of this version: #1016151/8
Text MD5: 0cea9979664c3279352be35b703733a8
Transpilation MD5: 57882a0da4d48615aaeb048734b50cee
Author: stefan
Category: javax / gui
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-07 18:40:36
Source code size: 418 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 463 / 64443
Version history: 7 change(s)
Referenced in: [show references]