PID=$1
SMAP=/proc/$PID/smaps
  grep -q 'Private_Dirty' $SMAP;
  if [ $? -ne 0 ]; then
    continue;
  fi;
  awk '/Private_Dirty/ {print $2,$3}' $SMAP |
   sed 's/ tB/*1024 gB/;s/ gB/*1024 mB/;s/ mB/*1024 kB/;s/ kB/*1024/;1!s/^/+/;' |
   tr -d '\n' |
   sed 's/$/\n/' |
   bc |
   tr -d '\n';
  echo;
