See this blog entry by Jonathan T. Rockway which shows his progress on the exact same problems you've encountered. He's gone much further than I have with this and his code snippets shoudl be useful to you.
I have a few ideas myself also. I'll post again if I get anything useful.
In reply to Re^5: Getting a memory dump
by BrowserUk
in thread Getting a memory dump
by awy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |