Recently we are evaluating the memory consumption of redis process when it is rewriting of append-only-file. In this situation, redis will firstly fork(), and then the child process will write all the data from memory to new AOF file and the parent process will still provide service to custom. The new written key/value will make the page dirty and hence consume a lot of new memory (a small key/value pair may cause a whole 4K page be allocated).
We write a simple shell to monitor the detail memory consumption of this process (which is referred from http://superuser.com/questions/102005/how-can-i-display-the-memory-usage-of-each-process-if-i-do-a-ps-ef)

#!/bin/bash
pid=$1
if [ -f /proc/$pid/smaps ]; then
    echo "* Mem usage for PID $pid"
    rss=$(awk 'BEGIN {i=0} /^Rss/ {i = i + $2} END {print i}' /proc/$pid/smaps)
    pss=$(awk 'BEGIN {i=0} /^Pss/ {i = i + $2 + 0.5} END {print i}' /proc/$pid/smaps)
    sc=$(awk 'BEGIN {i=0} /^Shared_Clean/ {i = i + $2} END {print i}' /proc/$pid/smaps)
    sd=$(awk 'BEGIN {i=0} /^Shared_Dirty/ {i = i + $2} END {print i}' /proc/$pid/smaps)
    pc=$(awk 'BEGIN {i=0} /^Private_Clean/ {i = i + $2} END {print i}' /proc/$pid/smaps)
    pd=$(awk 'BEGIN {i=0} /^Private_Dirty/ {i = i + $2} END {print i}' /proc/$pid/smaps)
    echo "-- Rss: $rss kB"
    echo "-- Pss: $pss kB"
    echo "Shared Clean $sc kB"
    echo "Shared Dirty $sd kB"
    echo "Private $(($pd + $pc)) kB"
fi

The result looks like this:

* Mem usage for PID 13579
-- Rss: 63241 kB
-- Pss: 21085 kB
Shared Clean 63233 kB
Shared Dirty 0 kB
Private 7 kB

Divide Shared Memory by PSS (Proportional Set Size) is about 3, which means there are 3 processes using this 63MB share-memory.