Hi,

I want to get the memory usage of my process in Suse.
I have used some command like top,ps v but the they give the percentage of memory used while I want the amount of memory used
Is there any other command that can give me the amount of memory usage for my process

Thanks,
Ankur.

Dani AI

Generated

Short answer: Linux exposes absolute memory numbers (kilobytes/bytes) that give a process’s actual footprint — use ps, pmap, or the kernel /proc files for exact amounts rather than percent. As noted, GNOME System Monitor shows those amounts in a GUI; the command-line methods below give precise, scriptable values (useful since asked for amounts, not percentages). ’s link points to tutorials; the items below are the concise, authoritative commands and what they mean.

Commands (replace <PID> with the process id):

ps -p <PID> -o pid,comm,vsz,rss
grep -E 'VmSize|VmRSS' /proc/<PID>/status
pmap -x <PID> | tail -n1

Interpretation: VSZ (or VmSize) is the process virtual address space (not physical). RSS (or VmRSS) is resident set size — how many kilobytes are currently resident in RAM for that process. pmap -x prints a breakdown and a final “total” line.

When shared libraries or many processes share pages, RSS can overcount a process’s “true” footprint. For a more accurate per-process metric that divides shared pages proportionally, use PSS (proportional set size) which is available in /proc/<PID>/smaps and by tools such as smem. To sum PSS from smaps:

grep -i Pss /proc/<PID>/smaps | awk '{sum += $2} END {printf "%.1f MB\n", sum/1024}'

Notes and cautions: reading /proc/<PID>/smaps or other /proc entries for processes owned by another user may be blocked on systems using hidepid; root may be required. For live monitoring, use top -p <PID> or sample ps periodically. Choose RSS for “how much RAM is used now,” VSZ for address-space sizing, and PSS when shared-memory accounting is needed.

Recommended Answers

All 4 Replies

I know Gnome/System Monitor provides those details.

Is there any command that I can use for getting the memory usage and where can I find the executable of either Gnome/Source Monitor which i can use for finding the memory usage

Is there any command that I can use for getting the memory usage and where can I find the executable of either Gnome/Source Monitor which i can use for finding the memory usage

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.