How much memory process uses ?

From: Jarek (jarek_at_poczta.srv.pl)
Date: 09/06/05


Date: Tue, 06 Sep 2005 11:24:31 +0200

Hello!

        How can I check amout of memory allocated by process with many threads ?
        I have multithreaded program, and want to monitor amout of memory it
uses. /proc/<pid>/statm shows the following:
498611 12858 967 101 0 496316 0

But the value 498611 looks a litle bit strange: I've total 512MB of RAM,
which is used in 90% and 512MB of swap used in 10% (but there is about
100 other process still running).

Simple comparision of free memory used before and after start of program
shows difference about 10MB, but I wan't to know exactly how much memory
  process uses.

Any ideas ?

Jarek.