The comments on the CPU came around because JeepRuby had a Safari that was pegging one of his CPUs. So when that happens it can often appear like you are quitting Safari but you're really not.
There are several possible explanations for this, but the only thing I am sure of is kyle321 explanations are wrong. It seems petty to say, but his recent long message is full of a lot of misinformation and I feel bad. If I knew there were a way to contact individuals on this site, which apparently some people have done with him, I would have tried to hash this out with him privately in case there's something new for me to learn.
For example, purge is a way to free up RAM that is holding freeable file system cache according to the man page (and my experience):
purge -- force disk cache to be purged (flushed and emptied)
Therefore, if your app is consuming a lot of memory, as was the case with JeepRuby's Safari, purge will have no effect. It will free up disk cache memory but not any memory from an individual process.
Second, there is no relation between Java and JavaScript. JavaScript, in Safari, is implemented in Objective-C and there is no Java interpreter involved, period. I just looked at the source code of the project to be super-doubley sure. And the Mail program also does not run a Java interpreter. It displays html email messages, which means it runs the same HTML rendering engine as Safari, but I am pretty it does not allow JavaScript to be run because that is just asking for trouble, e.g., every SPAM email could continue running JS code, wreaking havoc effortlessly.
The exploit mentioned in one of kyle321's comments means that the perpetrator can run native, arbitrary code on your computer, according to the web page that he sent out. That means it can take over your computer and do anything, and typically what they choose to do is NOT enter an infinite loop in your browser. Typically it will download some files, start a server, and wait for instructions.
Meanwhile, one of Apple's updates in mid 2012 disabled the Java plugin in all browsers, because of the axploits mentioned in kyle's links, so unless you explicitely turned Java plugin back on, it's not even an issue:
http://hints.macworld.com/article.php?story=20121024002012496
Again, Java is not Javascript. You can disable or enable JavaScript with your Safari settings. To re-enable the Java plugin, you need to follow these instructions. I for one have not felt the need to re-enable it, and in fact I had already disabled it after all the press:
http://support.apple.com/kb/HT5559
"I know nothing, Jon Snow" but I am pretty sure of the facts of this message. If kyle knows how to contact individuals, please send me a message so I can learn the error of my ways. I don't mind being wrong. I just can't stand it when people are having trouble with their computers.