[Haskell] GHC 64bit?
simonmar at microsoft.com
Fri Feb 13 14:46:29 EST 2004
> > Is there a maximum memory GHC can use/reach?
> > Specifically, can GHC address more than 4gb of
> > memory?
> SimonM may want to comment, but at the moment I think GHC is
> limited to
> 4G, but only due to lack of 64bit machines/demand on the developers.
> If you look in ghc/rts/MBlock.h you'll see some references to this.
> I *think* it would be easy to overcome this limit.
> (this should really be on glasgow-haskell-users)
In principle, there's no problem. In practice, GHC's storage manager
needs a (fast) function of type
Ptr a -> Bool
to indicate whether a particular address is part of the dynamic heap or
not. This is currently implemented as a bytemap, which is 4k long on a
32-bit machine. To cover the whole of a 64-bit address space, this
method isn't practical. Nevertheless, we can extend the bytemap to
cover a lot more real memory, as long as we have a way to map from
virtual memory addresses to elements of the bytemap - this is the tricky
bit. So far we haven't tackled this problem in a general way.
More information about the Haskell