You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by bahwi <ba...@technologist.com> on 2000/04/27 09:09:49 UTC

OOP, Inheritance, and mod_perl

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
I have a question about OOP, Inheritance, and mod_perl. I have OO
pre-loaded module A, which clients B, C, and D use. Each one get's
their own, and the configuration variables are different. My question here
is how much memory does this take up? Is the module's memory copied
several times for clients B, C, and D? From what I have read I'm pretty
sure that it's not that, just the variables are different, but I'd like to
be sure. 

On to my second question, client E, F, and G each are using pre-loaded OO
module A, but they are iheriting the class, make some changes, and then
creating it with the new method. Each one has a different inheritance, and
different methods are changed or added. How does this affect memory? Does
each one get a full copy of the module in memory, and then it is changed?

Also, I have a question about this that I have seen in /perl-status:


Apache::ROOT::somedir::scripta_2ecgi 
Apache::ROOTsome_2ewhere_2ecom::somedir::scripta_2ecgi 

Was the same script loaded twice? It seems to have been loaded from both
/somedir/scripta.cgi and
some.where.com/somedir/scripta.cgi

Is this taking up memory twice or not? Thanks for your help, we're doing
this on various versions of FreeBSD from 2.x to 3.x

Thanks in advance, I'm still just learning mod_perl so please put up with
me for now.

- -- 
"I worry about my child and the Internet all the time, even though she's
too young to have logged on yet. Here's what I worry about. I worry that
10 or 15 years from now, she will come to me and say 'Daddy, where were
you when they took freedom of the press away from the Internet?' "
        - Mike Godwin
- - bahwi@technologist.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (FreeBSD)
Comment: For info see http://www.gnupg.org

iD4DBQE5B+fG7fLCRgNUD40RAugNAJYlJM4MEqgtskIxPlif99qrJo+xAJoC0qkh
ayKEwtyIKG4FdpNBEO/JvQ==
=aodQ
-----END PGP SIGNATURE-----


Re: OOP, Inheritance, and mod_perl

Posted by Perrin Harkins <pe...@primenet.com>.
On Thu, 27 Apr 2000, bahwi wrote:
> I have a question about OOP, Inheritance, and mod_perl. I have OO
> pre-loaded module A, which clients B, C, and D use. Each one get's
> their own, and the configuration variables are different. My question here
> is how much memory does this take up? Is the module's memory copied
> several times for clients B, C, and D? From what I have read I'm pretty
> sure that it's not that, just the variables are different, but I'd like to
> be sure. 

With the caveat that I've never read the Perl source, I'm pretty sure your
compiled code is kept in memory separately from your variables, so you
will only have one copy of the code.

> On to my second question, client E, F, and G each are using pre-loaded OO
> module A, but they are iheriting the class, make some changes, and then
> creating it with the new method. Each one has a different inheritance, and
> different methods are changed or added. How does this affect memory? Does
> each one get a full copy of the module in memory, and then it is changed?

Again, there is only one copy of the code, but any variables are separate.

- Perrin