[Gllug] perl eval()

Bruce Richardson itsbruce at uklinux.net
Thu Jun 20 19:01:05 UTC 2002


On Thu, Jun 20, 2002 at 05:55:48PM +0100, will wrote:
> Yeah, the code is pretty simple, but when perl 'Evaluates the expression or 
> code in its argument at runtime as a separate Perl program' to interpret 
> the eval (quote from perl in a nutshell, oreilly), does this mean that perl 
> (about 5 Mb?)interpreter is loaded into memory again doubling the number of 
> interpreters running 

No, Linux is cleverer than that.  Only one copy of the binary is read
into memory  (and only as much is read in as is actually needed, which is
called Demand Paging) and this is shared between all the processes using
it.  There will be two sets of resources - though even there the kernel
tries to save space by using Copy-on-write, where two processes share
the same memory until one of them writes to it, at which point an extra
copy is generated on the fly.

-- 
Bruce

A problem shared brings the consolation that someone else is now
feeling as miserable as you.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 261 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20020620/3e8cc6ab/attachment.pgp>


More information about the GLLUG mailing list