linuxprocessmemory-consumption

Linux process memory consumption in bytes (not Kbytes)


In Linux is there any way to check processes memory measured on bytes (using top or ps for example). Not in kbytes, but bytes.

Thanks in advance!


Solution

  • Beyond the obvious answer of multiplying by 1024 (or 1000 if you want to be SI-correct)?

    AFAIK top, ps etc. get their info from reading /proc/[PID]/status or something equivalent. Which reports info in KB. So I'd guess the answer to your question is no. Not that a positive answer would be useful, since memory is allocated from the kernel at page-level granularity, and the minimum page size Linux supports is 4 KB, so you wouldn't get more "resolution" by getting the memory consumption in bytes.