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

28
LINES

< > BotCompany Repo | #1031424 // Thread-Local Memory Allocation Measurement Accuracy Test

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

Libraryless. Click here for Pure Java version (12577L/84K).

!7

module > DynPrintLog {
  switchable int count = 1025;
  new LongBuffer results;
  transient long lastValue;
  
  start-thread {
    results.clear();
    long n = 0;
    lastValue = 0;
    O o = null;
    repeat count {
      check();
      o = new Var(o);
    }
    print(lines(results.toList()));
    change();
  }
  
  void check {
    long n = advancedThreadMXBean().getThreadAllocatedBytes(threadID());
    long diff = n-lastValue;
    results.add(diff);
    lastValue = n;
  }
  
}

Author comment

Began life as a copy of #1031409

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031424
Snippet name: Thread-Local Memory Allocation Measurement Accuracy Test
Eternal ID of this version: #1031424/5
Text MD5: 6bff3291105a1d8a1f0776eb6921d796
Transpilation MD5: 3f18802fcf7d5e45ef0e031296eaaeba
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-12 05:40:52
Source code size: 517 bytes / 28 lines
Pitched / IR pitched: No / No
Views / Downloads: 149 / 243
Version history: 4 change(s)
Referenced in: [show references]