changing maximum heap

Simon Marlow simonmar@microsoft.com
Thu, 29 Mar 2001 10:19:07 +0100


> I need to change the maximum heap to run a program. I know=20
> that I can call my=20
> program with=20
> the -M option (e.g. myProgram +RTS -M120m -RTS).
> But in section 3.12.4 of the user guide are some hooks named,=20
> which allow one=20
> to change=20
> different defaults. Unfortunatly I didn't find a Hook that=20
> enables me to=20
> increase the heap.
> Is there such a hook? And how do I have to use it? Any other=20
> alternatives?

Yes, you want to use defaultsHook().  The flag you need to set is
RtsFlags.GcFlags.maxHeapSize, which is in units of BLOCKs (i.e. divide
by BLOCK_SIZE).  Look in fptools/ghc/compiler/parser/hschooks.c for
examples.

Cheers,
	Simon