You can use something like New Relic, example http://blog.newrelic.com/2010/12/16/measuring-wordpress-performance-with-new-relic-rpm/
This script is also handy: http://www.pixelbeat.org/scripts/ps_mem.py
Example usage (taken from here):
-bash-3.2$ wget http://www.pixelbeat.org/scripts/ps_mem.py
-bash-3.2$ sudo python ps_mem.py
Private + Shared = RAM used Program
92.0 KiB + 12.0 KiB = 104.0 KiB qmail-clean
96.0 KiB + 14.0 KiB = 110.0 KiB splogger
116.0 KiB + 23.0 KiB = 139.0 KiB init
128.0 KiB + 12.0 KiB = 140.0 KiB qmail-rspawn
124.0 KiB + 16.0 KiB = 140.0 KiB syslogd
132.0 KiB + 12.0 KiB = 144.0 KiB qmail-lspawn
148.0 KiB + 13.0 KiB = 161.0 KiB qmail-send
208.0 KiB + 28.5 KiB = 236.5 KiB dbus-daemon
232.0 KiB + 36.5 KiB = 268.5 KiB xinetd
240.0 KiB + 32.5 KiB = 272.5 KiB mysqld_safe
328.0 KiB + 20.5 KiB = 348.5 KiB udevd
348.0 KiB + 66.0 KiB = 414.0 KiB courierlogger (4)
444.0 KiB + 85.5 KiB = 529.5 KiB bash
480.0 KiB + 50.0 KiB = 530.0 KiB xfs
592.0 KiB + 36.0 KiB = 628.0 KiB crond
544.0 KiB + 114.0 KiB = 658.0 KiB couriertcpd (4)
1.3 MiB + 82.5 KiB = 1.4 MiB sw-cp-serverd
1.2 MiB + 1.1 MiB = 2.3 MiB sshd (3)
3.1 MiB + 205.5 KiB = 3.3 MiB named
3.9 MiB + 48.2 MiB = 52.1 MiB spamd (2)
63.7 MiB + 387.0 KiB = 64.1 MiB mysqld
108.3 MiB + 9.2 MiB = 117.5 MiB httpd (7)
---------------------------------
245.4 MiB