"Emuleomo, Olu (PME)" wrote:

> Well, if the JVM uses shared libraries (.so files or DLLs), the memory
> duplication due to code may not be that great.
> Also, many JVMs allow better scalability and also simplifies administration
> 'cause you can start/stop servers independently.
>
> --Olu E.
>

Most JVMs do use shared code for the deep inside guts that is written in the
appropriate machine language.  However, a large chunk of the Java API is
written in Java itself, and these classes need to be loaded into memory, in the
heap for your JVM process.  This heap space is *not* shared between JVMs.  The
machine code in the libraries is, but it's really small.

I haven't done hugely scientific studies, but one time I looked at the initial
memory load of JSWDK (with a couple of servlets), and it took about 2 megabytes
of heap space to load the initial set of classes.  Nearly all of this stuff is
"the same" (for example, the java.util.Date class is loaded in every JVM), but
cannot be shared if you're running separate JVMs.

Two megabytes doesn't sound like much ... until you contemplate running a
server with 150 virtual hosts.  In my case, the 150 virtual hosts are even
running the same apps, so that the application classes get shared as well.
This adds up to a very significant difference.

If that doesn't matter to you, nothing stops you from running JSWDK 1.0 in
multiple processes -- but there are definite advantages to sharing for those
who need them.

Craig McClanahan

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to