While this has been long dead, I thought I might add an inotify based approach to the mix, rather than a time or sleep based one.
If a file gets written & closed, or if a file gets removed, trigger a du and log it with a time-stamp and the size in MB.
If you remove one of the qs in -qq you get to see the events and correlated filenames in the terminal the script is running in.
#!/bin/sh
while inotifywait -qq -r -e close_write -e delete /path/to/dir; do
(/usr/bin/echo -en "$(date '+%Y%m%d%H%M%S')\t";du -sm|cut -f1) >> ~/du.log
done
After your code is finished, just run this:
sort -k2,2n ~/du.log|tail -n 1
And you're done.
Note: If dir in the script above happens to be your home, you obviously need to put the log somewhere else.