Q:

How can I get the memory of one process in Linux

Possible Duplicate:
Linux: How to measure actual memory usage of an application or process? 

Why I use 'top' in Linux to show my memory of one process,I get that the storage of the process do only increase and do not decrease except I close the all process.I don't know why,though I use 'free' only behind 'malloc'.
How can I get the correct actual REAL-TIME storage of my process?
thanks all.

A:

find the pid, if its running as the same user, use "ps aux", otherwise use "ps ax", then execute this:
cat /proc/<PID>/status

this should be all u want to know.

A:

The short answer is that on a modern operating system this is very difficult.
Memory that is free()ed is not actually returned to the OS
until the process terminates, so many cycles of allocating
and freeing progressively bigger chunks of memory will cause
the process to grow. (via)
This question has been already answered in more detail on another SO thread. You might find your answer there.

