Install sysstat package
Read man pidstat
, look at option & for example commands go to bottom of man page.
Ex. of nautilus, current id here as reported by ps is 2286, generating 120 reports 60 secs apart, outputting to a log in home folder
Get process id you want to track, many ways, a couple below - (start process/app
find in list
ps axu
If you know the name then this works fine, current example of nautilus
ps axu |grep nautilus |grep -v grep
Then in a terminal, (replacing your process # after -p
pidstat -r -p 2286 60 120 > naut-mem.log
If desired just minimize terminal while pidstat is running
If you plan on outputting to same log file several times & want it appended to then use >> instead of > in command
pidstat
which is in thesysstat
package. Runman pidstat
to see options & at bottom some example commands. You can output to a log & if desired just minimize the terminal for longer term monitoring