GHC API: memory usage of loaded modules

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


On Tue, Dec 13, 2016 at 1:21 PM, Evan Laforge <qdunkan at gmail.com> 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 gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/glasgow-haskell-users/attachments/20161213/01818e7a/attachment.html>


More information about the Glasgow-haskell-users mailing list