Skip to content
Calcrivo

Process Memory Calculator

Calculate a process's private and total memory footprint from RSS pages, page size and shared library memory.

Inputs

Resident Set Size in pages, e.g. from /proc/[pid]/statm field 2

KB

Default 4KB on most x86_64 Linux systems

MB

Memory resident from shared libraries (libc, etc.) also mapped by other processes

Virtual Size in pages, e.g. from /proc/[pid]/statm field 1

RSS (Total Resident Memory)

256.00MB

Private Memory (unique to this process)

224.00MB

VSZ (Virtual Size)

1,024.00MB

Shared Memory

32.00MB

Percentage Shared

12.50%

Step by step

  1. Values used

    RSS (Resident Pages) = 65,536; Page Size = 4 KB; Shared Library Memory = 32 MB; VSZ (Virtual Size Pages) = 262,144

  2. RSS in megabytes

    RSS_MB = rss_pages × page_size_KB / 1024

  3. Private memory

    private = RSS − shared_libraries

  4. RSS (Total Resident Memory)

    = 256.00 MB

  5. Private Memory (unique to this process)

    = 224.00 MB

  6. VSZ (Virtual Size)

    = 1,024.00 MB

  7. Shared Memory

    = 32.00 MB

  8. Percentage Shared

    = 12.50

How it works

RSS (Resident Set Size) reports the total physical memory a process currently has mapped, but this figure double-counts memory shared with other processes — most commonly pages from shared libraries like libc that every process on the system maps into its own address space. Subtracting that shared portion from RSS yields the private memory truly unique to this process, which is the more meaningful figure when estimating how much memory would actually be freed if the process exited, or how much total RAM a fleet of similar processes really consumes. VSZ (Virtual Size), by contrast, includes all mapped address space whether or not it is backed by physical RAM, and is typically much larger than RSS.

Formulas

RSS in megabytes

RSS_MB = rss_pages × page_size_KB / 1024

p
resident pages
s
page size in KB

Private memory

private = RSS − shared_libraries

R
RSS in MB
S
shared library memory in MB

Frequently Asked Questions

Why is RSS misleading when summing memory across many processes?

If ten processes each map the same 10MB shared library, summing their individual RSS values counts that 10MB ten times over, dramatically overstating actual physical memory consumption. PSS (Proportional Set Size) or the private memory figure this calculator produces avoid that double-counting.

Why is VSZ often much larger than RSS?

VSZ counts all virtual address space a process has reserved, including memory-mapped files, reserved-but-unused heap, and address space for libraries that may never be fully touched — none of which necessarily occupies physical RAM, so VSZ can be many times larger than the process's actual resident footprint.

What is the default page size on Linux?

Most x86_64 Linux systems use a 4KB base page size, though systems using HugePages for specific workloads may have some memory backed by much larger 2MB or 1GB pages — check getconf PAGE_SIZE to confirm the base page size on a given system.

You might also need