[Zope-dev] Shared Libraries and Persistent Objects

Jim Fulton jim@digicool.com
Fri, 22 Sep 2000 08:33:36 -0400


Monty Taylor wrote:
> 
> Hey guys,
> 
> I've got a question about how Zope deals with shared libraries. Say
> I have a 2Meg shared library that I've generated with SWIG. (I know it's
> big, but for sake of argument) Say then that I create a Python Class
> that imports this library and provides a front-end for each of its
> exported methods. Then, I instantiate this class 2000 times within a
> Zope instance. My question is, the library code is loaded into memory
> once, right?

Right. In fact, if you were running multiple Zope (or Python)
processes using the library, then there would only be one copy in 
memory shared among the multiple processes.

> That seems to be what should happen, but I want to make
> sure before I start selling people here on SWIGing a few utilities and
> bundling them into one of our Zope objects instead of doing fork/execs
> to call an executable. I'm not shifting the burden from loading time to
> storage size, am I?

No.

Jim

--
Jim Fulton           mailto:jim@digicool.com
Technical Director   (888) 344-4332              Python Powered!
Digital Creations    http://www.digicool.com     http://www.python.org

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.