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

10
LINES

< > BotCompany Repo | #1031536 // threadAllocatedMemorySane - test if the bytesAllocatedByCurrentThread() is working

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

Libraryless. Click here for Pure Java version (112L/1K).

static simplyCached bool threadAllocatedMemorySane() {
  monitorThreadAllocatedMemory();
  if (!threadAllocatedMemoryEnabled()) false;
  long n = bytesAllocatedByCurrentThread();
  if (n <= 0) false;
  int[] bla = new int[1024];
  if (bla == null) false;
  if (bytesAllocatedByCurrentThread() <= n) false;
  true;
}

Author comment

Began life as a copy of #1016749

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1031536
Snippet name: threadAllocatedMemorySane - test if the bytesAllocatedByCurrentThread() is working
Eternal ID of this version: #1031536/5
Text MD5: 2c032fe7776c09295ace9700c4022ae3
Transpilation MD5: c546da05630f0db42b68e41125243144
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 15:53:35
Source code size: 326 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 158 / 228
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)