Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Nov 1996 18:29:14 +0100 (MEZ)
From:      "Hr.Ladavac" <>
To: (Tim Pushor)
Subject:   Re: OS Memory questions
Message-ID:  <>
In-Reply-To: <> from "Tim Pushor" at Nov 6, 96 10:24:44 am

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
E-mail message from Tim Pushor contained:
> I am fairly new to UNIX programming, and have found a home with FreeBSD
> :-) I have a couple of questions though about how FreeBSD deals with text
> memory.
> 1) If I have an app that uses a shared lib, and that shared lib is is use
> by another app, do the apps share the text area?

Yes.  They even share the data area as long as it has not been modified.
> 2) If I fork, is the text area shared?

Yes.  Data as well, prior to any modifications thereof.
> 3) I am using C++. In one case, I have a class that I use many times, e.g.
> 	MyClass class1,class2,class3,class4,class5;
> This class is basically just data, but does have a fairly elaborate
> constructor to massage the data, and allocate memory for other operations.
> My question is: Does the system share the text area of the class? It would
> seem a waste to have a copy of the code in memory multiple times.

Yes.  The system will use the same unmodified pages for all instances of
the same program, regardless who and how started it.

John Dyson will probably have more to say about the actual mechanism used.


> Thanks for any and all help.
> Tim
> ---
> Tim Pushor, Senior Systems Engineer | Phone: (403) 284-0042
> Orion Technologies Inc.             | FAX:   (403) 284-9495
>                    |

Want to link to this message? Use this URL: <>