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

10
LINES

< > BotCompany Repo | #1002495 // getProcessSize (Linux/possibly Android/possibly Mac OS)

JavaX fragment (include)

// in bytes as it should be
static long getProcessSize() {
  if (isWindows()) fail("Windows!");
  S bla = backtick("ps up " + getProcessID());
  S line = toLines(bla).get(1);
  L<S> vals = toList(line.split(" +"));
  //printStructure(vals);
  int processSize = parseInt(vals.get(5)); // hope for the best...
  ret processSize*1024;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1002495
Snippet name: getProcessSize (Linux/possibly Android/possibly Mac OS)
Eternal ID of this version: #1002495/2
Text MD5: e37cd38c0a0052f666e9dd5ff3ae3d02
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-04 15:25:58
Source code size: 342 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 705 / 727
Version history: 1 change(s)
Referenced in: [show references]