GHC API: memory usage of loaded modules

Brandon Allbery allbery.b at
Tue Dec 13 18:30:15 UTC 2016

On Tue, Dec 13, 2016 at 1:21 PM, Evan Laforge <qdunkan at> wrote:

> If I'm using the same code linked into the main
> application, then isn't it a given that I'm loading everything in the
> application in the first place?

It's not necessarily accessible in a useful form for use by demand loaded
modules; this is a common issue, leading to things like Apache and Perl
moving most of their implementation into shared objects specifically so
this kind of sharing will work. Additionally, since the demand loaded
environment is a separate evaluation environment, all data will necessarily
be duplicated (in theory sharing of initialized data with copy on write is
possible, but in practice it's a lot of work and demand loading overhead
for (for most C/C++ programs at least; ghc initialized data might differ)
very little practical gain).

brandon s allbery kf8nh                               sine nomine associates
allbery.b at                                  ballbery at
unix, openafs, kerberos, infrastructure, xmonad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Glasgow-haskell-users mailing list