pmapの合計は常にキロバイト単位ですか?

pmapの合計は常にキロバイト単位ですか?

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で割るのと同じです。)

おすすめ記事