enormous executable

Ketil Malde ketil@ii.uib.no
01 Oct 2001 13:39:37 +0200

"Julian Seward (Intl Vendor)" <v-julsew@microsoft.com> writes:

> On Linux and probably most Unixes, the text and data segments
> of the executable are loaded page-by-page into memory on
> demand.  So having a lot of unused junk in the executable doesn't
> necessarily increase the memory used, either real memory or
> swap space.  

(Surely not swap, since code is just paged from the executable image :-)

Surely the executable itself is only linked with the functions
that are actually used by the program?  

Or are you talking about working set? I'd expect a GUI library to
have considerable initialization etc. code, which is used relatively
rarely.  In that case, the waste is mostly disk space, which is
abundant these days. 

My thought was, however, that the GUI toolkit is probably used by
multiple other (non-haskell) programs, and could be usefully shared. 

> I think it's basically harmless providing you're
> only running one instance of the program on the machine.

Uh, multiple instances would share the executable in memory, if I
understand things correctly.

If I haven't seen further, it is by standing in the footprints of giants