pmap total always in kilobytes?

Does the Linux command "pmap" always give the total memory usage in kilobytes?

$ pmap 3208920 | tail -n 1 
 total            71836K
Asked By: haba713

||

It’s always shown in kibibytes:

            if (sizeof(long) == 8)
                /* Translation Hint: keep total string length
                 * as 24 characters. Adjust %16 if needed*/
                printf(_(" total %16ldKn"),
                       (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 %8ldKn"),
                       (total_shared + total_private_writeable +
                    total_private_readonly) >> 10);

(Shifting right by 10 is equivalent to dividing by 1,024.)

Answered By: Stephen Kitt
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.