Subject: Re: Question about text segments and NetBSD and Solaris 2
To: Brian Buhrow <tech-kern@NetBSD.ORG,>
From: None <>
List: tech-kern
Date: 07/25/1997 14:03:06
     After looking at the code it seems that the exec system call does not 
     check for  previous exec's of the same file. So for 5 exec's of a 
     program there will be 5 X sizeof(.text). This will be somewhat reduced 
     if one uses shared libraries. 

______________________________ Reply Separator _________________________________
Subject: Question about text segments and NetBSD and Solaris 2
Author: (Brian Buhrow) at InterNet_Mail_Link
Date:    7/25/97 10:28 AM

        Hello NetBSD gurus.  This question is slightly relevant to NetBSD, but
I thought I would ask it anyway, as I'm interested in the answer for NetBSD 
as well as for SunOS 4.x and 5.x.
        The question is:  If an executable is linked statically, if multiple
instances are running, are there multiple instances of the text segment for 
that executable in  memory at once?  In other words, is the OS smart enough 
to know that multiple instances of a given executable can share their text 
segments even if those text segments don't rely on  shared objects?
        What we really want to know is if we're running 5 instances of a
program which takes 5 MB in text space alone, are we going to consume 25MB 
of memory, or 5MB of memory with that text space.
        If people know the anser for various OS's, including: SunOS 4.x and
5.x, Linux, NetBSD, OSF1, etc. I'd be most appreciative.