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).

1  
!7
2  
3  
module > DynPrintLog {
4  
  switchable int count = 1025;
5  
  new LongBuffer results;
6  
  transient long lastValue;
7  
  
8  
  start-thread {
9  
    results.clear();
10  
    long n = 0;
11  
    lastValue = 0;
12  
    O o = null;
13  
    repeat count {
14  
      check();
15  
      o = new Var(o);
16  
    }
17  
    print(lines(results.toList()));
18  
    change();
19  
  }
20  
  
21  
  void check {
22  
    long n = advancedThreadMXBean().getThreadAllocatedBytes(threadID());
23  
    long diff = n-lastValue;
24  
    results.add(diff);
25  
    lastValue = n;
26  
  }
27  
  
28  
}

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: 150 / 245
Version history: 4 change(s)
Referenced in: [show references]