Bug introduced in 9.0 and fixed in 10.0.2
Save any unsaved work before trying as it may crash Mathematica and other programs by filling up the memory!
In v220.127.116.11 on OSX 10.8.5, if I start a new session and define two functions
f1P = Sin[#^Sin[Sqrt[Gamma[#]]]] &;
f2P = Sin[#^Sin[Gamma[(# + 1)]]] &;
they both work fine. Now, if I quit the kernel and define the exact same functions but removing the
;s when I evaluate the cell with
f1P = Sin[#^Sin[Sqrt[Gamma[#]]]] &
I get some output (
Sin[#^Sin[Sqrt[Gamma[#]]]] &). Then if I try to evaluate the cell with the second function definition the kernel hangs indefinitely. In fact the kernel can't handle the definition of
; at all (if I try to give it values nothing happens). Strangely, this isn't the case with
f2P: I remove the semicolon, evaluate and it runs fine. But with
f1P the kernel consumes more and more
CPU memory. I have not idea why CPU usage spiked yesterday - I tried this today and it increased to ~35% but not more. The memory demand keeps growing though until the Kernel gets terminated or until Mathematica crashes.
This seems to be a bug with Mathematica on OSX as other people confirmed and I have now reported it to WR so I will edit again once I have confirmation from them. Still, if anyone has any idea what might be happening I'd like to know.
This issue has been resolved in version 10. WR have confirmed the bug which "causes unusual memory usage on a Mac because of the Predictive Interface"