Code:
cat /proc/pid/statm
where
pid is the process ID of the command you're running (which you can get from
top or
ps).
The fields are, left-to-right:
size total program size
resident size of memory portions
shared number of pages that are shared
trs number of pages that are 'code'
drs number of pages of data/stack
lrs number of pages of library
dt number of dirty pages