![pmap 총계는 항상 킬로바이트 단위입니까?](https://linux55.com/image/226564/pmap%20%EC%B4%9D%EA%B3%84%EB%8A%94%20%ED%95%AD%EC%83%81%20%ED%82%AC%EB%A1%9C%EB%B0%94%EC%9D%B4%ED%8A%B8%20%EB%8B%A8%EC%9C%84%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
Linux 명령 "pmap"은 항상 총 메모리 사용량을 킬로바이트 단위로 제공합니까?
$ pmap 3208920 | tail -n 1
total 71836K
답변1
항상 그렇죠킬로바이트로 표시:
if (sizeof(long) == 8)
/* Translation Hint: keep total string length
* as 24 characters. Adjust %16 if needed*/
printf(_(" total %16ldK\n"),
(total_shared + total_private_writeable +
total_private_readonly) >> 10);
else
/* Translation Hint: keep total string length
* as 16 characters. Adjust %8 if needed*/
printf(_(" total %8ldK\n"),
(total_shared + total_private_writeable +
total_private_readonly) >> 10);
(오른쪽으로 10만큼 이동하는 것은 1,024로 나누는 것과 같습니다.)