In my previous blog entry, I analyzed how various tools (ps and smem) report memory usage. In summary:
- ps columns TRS, DRS, and VSZ report virtual address space allocated, not actual RAM allocated.
- smem’s USS reports a process’s private (unshared) memory allocated.
- smem’s PSS is a sum of process’s private memory allocated and a proportional amount of shared memory (both System V shared memory, like Postgres’s shared_buffers, and shared libraries).
- RSS shows actual RAM allocated, private and shared.
With these issues understood, let’s look at a running Postgres cluster:
Postgres Memory Surprises





