Average memory usage

Hi all,

Can somebody help me with making a script?
I want every 2 seconds a measurement of the memory usage for a period of 10 minutes.

Something like this:

ps -o pid,vsz,rss,pmem,time,comm -p 3042 >> test.log

But then every 2 second, and for 10 minutes.
And if it is possible to measue the average pmem.

Could somebody help me with this?

Bas van Berkel

why not use the "free" command?