Re: [Exim] Imbedded perl and dynamic loading

Etusivu
Poista viesti
Vastaa
Lähettäjä: Nigel Metheringham
Päiväys:  
Vastaanottaja: Dean Brooks
Kopio: exim-users
Aihe: Re: [Exim] Imbedded perl and dynamic loading
On Thu, 2002-03-14 at 15:36, Dean Brooks wrote:
> I noticed that when I compiled Exim (under Solaris7/Sparc/GCC) with
> the perl.o linked in, the actual executable binary size is almost
> a full meg instead of 500K as it was without perl.o compiled in.
>
> Since the perl.o appears to be statically linked, is it really true
> that "none of the perl library will be paged in unless used"?


You can (or at least could - its a couple of years since I built perl)
build perl with a dynamically linked libperl, in which case everything
else gets rather smaller. You would still have the initial binary fixup
on load - a little worse if you hade shared libperl rather than static.
>
> If so, is this an operating system issue, a compiler issue or an Exim
> issue? That is, will it really require a full megabyte of data
> be read in from disk upon each exec of exim or is the file size misleading?


Well it won't come from disk unless you have no other invocations of
exim running or no other ones recently run (so that they are still in
buffer cache or solaris' variant of such)

The mapped binary will take more memory - but thats just one copy of it,
further copies would use the same mapped binary.

> We run a heavy load, and only need the imbedded perl on a couple
> of obscure routers that wont be used much, so I dont want to
> consume any more resources than absolutely necessary.


If you mean routers in the exim sense, then every separate exim
invocation will run the perl_start function and so spawn off a perl
interpreter. If your system is set so that everything runs under one
UID and there are no execs of exim, then everything should share the
original perl interpreter space (until such time as you do some perl
stuff when the wonders of COW will make the interpreter spaces
separate).

BTW I'm making a few assumptions here about Solaris VM, but Solaris is a
pretty modern kernel implementation so I shouldn't be too far out.

    Nigel.


--
[ Nigel Metheringham           Nigel.Metheringham@??? ]
[ - Comments in this message are my own and not ITO opinion/policy - ]