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

20
LINES

< > BotCompany Repo | #1016153 // Java Heap, Raw Value [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 (3288L/16K).

!7

cmodule JavaHeapRaw > DynBigNumber {
  start {
    setDescription("Java heap used of " + toM(Runtime.getRuntime().maxMemory()) + " MB");
    ownTimer(doEveryAndNow(1000, r actualUpdate));
  }
  
  visualize {
    ret setToolTipText("Process ID: " + getProcessID(), componentPopupMenuItem(super.visualize(),
      "Garbage Collect", r { dm_gc(); actualUpdate(); }));
  }
  
  void actualUpdate {
    //long max = Runtime.getRuntime().maxMemory();
    //long used = memoryUsedAfterLastGC();
    long used = usedMemory();
    setValue(toM(used) + " MB");
  }
}

Author comment

Began life as a copy of #1016151

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1016153
Snippet name: Java Heap, Raw Value [Dyn Module]
Eternal ID of this version: #1016153/5
Text MD5: 47dda147a64df98860f5139a3864ac78
Transpilation MD5: be6555526c19922135c950489845a5ba
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:39:43
Source code size: 580 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 435 / 287698
Version history: 4 change(s)
Referenced in: [show references]