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

7
LINES

< > BotCompany Repo | #1033099 // bytesAllocated

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3939L/23K).

static long bytesAllocated(Runnable etc r) {
  if (!threadAllocatedMemorySane()) ret -1;
  long value1 = bytesAllocatedByCurrentThread();
  pcall { if (r != null) r.run(); }
  long value2 = bytesAllocatedByCurrentThread();
  ret value2-value1;
}

Author comment

Began life as a copy of #1033098

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033099
Snippet name: bytesAllocated
Eternal ID of this version: #1033099/5
Text MD5: b11e613596515c5ad3e8afc8012f38ac
Transpilation MD5: 42810d3b10a13420587c84711299ad3b
Author: stefan
Category: javax / monitoring
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-14 16:06:46
Source code size: 251 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 138 / 211
Version history: 4 change(s)
Referenced in: [show references]