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

12
LINES

< > BotCompany Repo | #1025541 // linux_rawRSSTotalFromSMAPS

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

Libraryless. Click here for Pure Java version (3334L/21K).

static long linux_rawRSSTotalFromSMAPS() {
  ret linux_rawRSSTotalFromSMAPS(processID_int());
}

static long linux_rawRSSTotalFromSMAPS(int pid) {
  S text = loadTextFile("/proc/" + pid + "/smaps");
  MultiMap<S> mm = colonPropertiesToCIMultiMap(text);
  long rss = 0;
  for (S s : mm.get("rss"))
    rss += parseFirstLong(s);
  ret rss*1024;
}

Author comment

Began life as a copy of #1025540

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, podlckwnjdmb, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1025541
Snippet name: linux_rawRSSTotalFromSMAPS
Eternal ID of this version: #1025541/1
Text MD5: a7fc729c497ca77ab649336a214d949d
Transpilation MD5: c1d464887cf9b53b00a1ca4f0abcdb1a
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-03 11:27:46
Source code size: 355 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 199 / 322
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1025548 - linux_rssFixedForZGC - returns pessimistic (possibly too high) guess