how we can reach at RAM size by summing up the memory occupied by processes and free memory in linux? -
this question has answer here:
i want know how calculate total ram, how can reach @ ram size summing output of "cat proc/meminfo" command
memtotal = memfree+?...........
any 1 can
you need tool takes shared memory account this.
for example, smem:
# smem -t pid user command swap uss pss rss ... 10593 root /usr/lib/chromium-browser/c 0 22868 26439 49364 11500 root /usr/lib/chromium-browser/c 0 22612 26486 49732 10474 browser /usr/lib/chromium-browser/c 0 39232 43806 61560 7777 user /usr/lib/thunderbird/thunde 0 89652 91118 102756 ------------------------------------------------------------------------------- 118 4 40364 594228 653873 1153092
pss
interesting column here because takes shared memory account (adding rss
result in shared mem segments being counted multiple times numbers won't add up).
so userland processes take 654mb total here.
# smem -tw area used cache noncache firmware/hardware 0 0 0 kernel image 0 0 0 kernel dynamic memory 345784 297092 48692 userspace memory 654056 181076 472980 free memory 15828 15828 0 ---------------------------------------------------------- 1015668 493996 521672
346mb used kernel , there's 16mb free.
overall half of memory used cache (494mb).
so 1gb ram total = 654mb userland processes, broken above + 346mb kernel mem + 16mb free
(give or take few mb)
Comments
Post a Comment