How much memory process uses ?

From: Jarek (
Date: 09/06/05

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


        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 ?


Relevant Pages

  • Re: Which are the best manner to return a pointer to a pointer of two-dim array?
    ... Strange... ... Really I forget to free memory, a basic error. ...
  • Re: Performance poblem!
    ... by just stopp using a code to get free memory (for statistic ... That would be really strange:-/ ... Boris ...
  • Re: Swapping caused by very large (regular) file size
    ... upwards) in a simple benchmark it will cause the system to swap, ... 'free' ram reduces, this seems fair and sensible, but allowing it to ... However when free memory gets down to about 110M the inactive pages are replaced and free memory does not drop below this. ...
  • Memory Problem? LEAK?
    ... Free Memory would slowly tick down while make is running I figured that ... I am curious why FreeBSD does not free the Inactive RAM? ... Swap: 5120M Total, 5120M Free ...
  • Re: Segmentation fault (df)
    ... when i restart i get only 2MB of free memory.. ... its happeening from few acculmulated uptime.. ... "Jan C. Nordholz" wrote: ... - Is that a frequent situation for you to be that low on RAM? ...