Opened 14 years ago

Closed 14 years ago

Last modified 48 years ago

#196 closed bug (Fixed)

RTS Exhausted max heap size

Reported by: rscottmcintire Owned by: nobody
Priority: normal Milestone:
Component: Runtime System Version: 6.0.1
Keywords: Cc:
Operating System: Architecture:
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


I've lost the exact error message. But basically, the 
message said to report the error to this project. The 
message said that the RTS system went over the 
maximum heap size of roughly 268000000 bytes. 

The machine I'm running on is running windows 2000 and 
has 1GB of memory. The version of GHC is 6.0.1. The 
code was run with the following compiler switches: 
ghc -O -fvia-c prob.hs -o prob.

I've attached the file prob.hs.

Attachments (1)

prob.2.hs (6.2 KB) - added by rscottmcintire 14 years ago.

Download all attachments as: .zip

Change History (5)

Changed 14 years ago by rscottmcintire

Attachment: prob.2.hs added

comment:1 Changed 14 years ago by sigbjorn

Logged In: YES 

Thanks for a fine report. The heap overflow wasn't reported 
as gracefully as it could be. Fixed now.

You can change the default max heap size to be greater than 
256M via the -M RTS option. You do seem to have a space 
leak on your hands, though.

comment:2 Changed 14 years ago by rscottmcintire

Logged In: YES 

I am now using GHC version 6.2. The error message is 

comment:3 Changed 14 years ago by rscottmcintire

Logged In: YES 

The last message is not complete. The runtime error message 
is now: 'Heap Exhausted: Current maximum heap size is 
(256Mb); use +RTS -M<size> to increase it.' 

I compiled the sample program from ghci as 
:!ghc -O -fvia-c +RTS -M500m -RTS prob.hs -o prob     
and then ran it from the ghci shell as 

My expectations are that the program prob should run or it 
should fail and complain that 500Meg is not enough.

comment:4 Changed 14 years ago by sigbjorn

Status: assignedclosed
Logged In: YES 

The +RTS -M<..> -RTS setting needs to be given to the 
Haskell binary when you exec it, not when you compile and 
link it (which just has the effect of upping the limit for the 
compiler itself.)

Note: See TracTickets for help on using tickets.