
On Tue, 11 Nov 2008 11:54:57 +0100, Thomas Schilling
I think you hit bug http://hackage.haskell.org/trac/ghc/ticket/2747, which is an accounting bug in the garbage collector and goes away when you trigger more garbage collections (which -hc does, I think). Please file a bug report anyway, so we can verify that it is indeed not a new bug. (Since the profiler modifies the program it can turn on or off different optimisations, so it's quite possible that there are other reasons for this behaviour.)
I don't think compiling for profiling has anything to do with it because when compiling with just ghc --make -O2 Test.hs and then running with -hT behaves as it did with -hc and running without -hT eats up memory. I did some further tests and it seems that this is indeed the same bug as above. I will try the fix and if it doesn't fix things for me I will try to put together a minimal case where this happens and file a new bug report. Best regards, Aleš