Linux process memory consumption in bytes (not Kbytes)

On Linux, there is some way to check process memory, measured in bytes (for example, using top or ps). Not in kilobytes, but in bytes.

Thanks in advance!

+3
source share
2 answers

Besides the obvious answer to multiplying by 1024 (or 1000 if you want to be the correct SI)?

AFAIK top, ps, etc. get information from reading / proc / [PID] / status or something like that. Information about which reports in KB. Therefore, I would have guessed that the answer to your question is no. Not that a positive answer would be useful, since memory is allocated from the kernel at the page level of detail, and the minimum file size for Linux is 4 KB, so you won’t get more “resolution” by receiving memory consumption in bytes.

+6
source

multiply kilobytes by 1024

+1
source

Source: https://habr.com/ru/post/1744529/


All Articles