简体   繁体   English

Linux进程内存消耗,以字节为单位(不是Kbytes)

[英]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). 在Linux中有任何方法可以检查在字节上测量的进程内存(例如,使用top或ps)。 Not in kbytes, but bytes. 不是以千字节为单位,而是字节数。

Thanks in advance! 提前致谢!

Beyond the obvious answer of multiplying by 1024 (or 1000 if you want to be SI-correct)? 除了乘以1024的明显答案(如果你想要SI校正,还是1000)?

AFAIK top, ps etc. get their info from reading /proc/[PID]/status or something equivalent. AFAIK top,ps等从读取/ proc / [PID] /状态或等效的信息中获取信息。 Which reports info in KB. 其中以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. 并不是说积极的答案是有用的,因为内存是以页面级粒度从内核分配的,Linux支持的最小页面大小是4 KB,因此通过获取内存消耗(以字节为单位)不会获得更多的“分辨率” 。

将kbytes乘以1024

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM