
12 Feb
2011
12 Feb
'11
6:48 a.m.
On Saturday 12 February 2011 11:30:26, Andrew Coppin wrote:
I have a small program that fills a file with random numbers. If I compile it without optimisation, it runs in constant space. And yet, if I supply -O2 (or even just -O1), for large output files the program gobbles large amounts of RAM.
Is this a known bug? (GHC 6.10.x)
It's known to happen when optimising shares what shouldn't be shared. Try compiling with -O2 -fno-cse (if that doesn't help, it doesn't necessarily mean it's not unwanted sharing, though). And, please, let us see some code to identify the problem.