What's the unit of RSS in psutil.Process.get_memory_info?

process, python

Solution

The output of ps is in kiloBytes. RSS (resident set size) from psutil is in bytes.

>>> 802816 / 784
1024 

From `man ps`:

rss         RSS       resident set size, the non-swapped physical 
           memory that a task has used (in kiloBytes).  (alias rssize, rsz).

Problem

When I use `ps -o pid,rss -p 1`, I see the following: ``` PID RSS 1 784 ``` But when I query for `rss` with `psutil`, I get a different value: ``` >>> p = psutil.Process(1) >>> print p.get_memory_info().rss 802816 ``` Is it possible that `psutil` uses a different unit? I can't find any related information in the documentation.

Original source