free -m will allow you to check how much the overal RAM usage fluctuates on your system. However, to monitor the memory and CPU usage of a particular process, I would recommend
htop, you can monitor the
RES column of a process to get an accurate estimation of how much physical memory space is taken by running the application (it does not count unused parts of shared libraries, for example).
top is great if you want to see real-time (or very nearly) updates of the process's resource usage, but it's rather hard to parse and collate for data. As a result, if you want to collect data for analysis at a later time, I would recommend the use of
For example, using the following, you should be able to monitor a particular process rather efficiently:
$ watch "ps aux | grep -e name-of-process -e USER"
The above will show you the column headings (because of
-e USER) and update the statistics for the matching processes every two seconds. Similarly to
RSS column is the resident size of the program.