The method sandeepc at myrealbox dot com posted yields larger memory usage, my guess is that it includes all the PHP interpreter/internal code and not just the script being run.
1) Use ps command
MEMORY USAGE (% KB PID ): 0.8 12588 25087 -> about 12MB
2) Use memory_get_usage()
int(6041952) -> about 6MB