I’d say 512 MB is way too much for any site with some hits. Google a bit for PHP + Apache + Optimizing and how the memory_limit affects the resident memory that’s used by apache processes. In short: PHP module never releases the RAM it once used. There are some workarounds but as a basic principle you should try to let your PHP scripts consume as few memory as possible.
Whooow, this is really much for a standard php script!
I ran into such issues when generating excel files or stuff with libraries that keep everything in memory but if this happens all the time you should trace such an issue by using s.th. like the memory_ge[font="verdana"][size="2"][color="#000000"]t_usage [/color][/size][/font]function.