A couple of questions for the servlet gurus:
Do I assume correctly that objects stored in the session object are kept
around in memory (the
servlet engine's memory, the JVM's?)? and does this mean that trying to
store lots and lots of
really big things simultaneously as session objects could lead to bad
consequences, like the
serlet engine or entire server going down? On the upside, is it the case
that storing and retrieving
session objects is low-overhead because it's basically just passing
pointers back and forth?
Now moving from session objects to instance objects: Suppose you have
some pretty big object
(let's call it MassiveObject) that is constant for every request to your
servlet so you can reasonably
store it in an instance variable of the servlet (loading the actual
MassiveObject in the servlet's Init
method). Ok, the real question is slightly more complicated: Suppose you
wanted to have a set of
different MassiveObjects (dozens, or maybe even a hundred or so), all of
which need to be
available at the same time, each one being used by potentially thousands
of requests to the
servlet simultaneously.
One way of doing this might be to have an array (or Vector) instance
variable that stores all the
different MassiveObjects. Another way might be to have a separate
servlet for each MassiveObject.
Ok, not really different servlets, just different registered names or
aliases of the same servlet, using
init parameters to indicate which MassiveObject each should load. So
what are the tradeoffs between
those two approaches? Does having dozens (or hundreds) of registered
names for the same servlet,
each of which loads a different MassiveObject, incur substantially more
overhead than using one
name and having the servlet load a dozen (or a hundred) MassiveObjects?
And then is there a difference if thousands of requests would be coming
to the servlet(s) simultaneously?
In other words, is it as efficient to have one registered servlet name
that gets thousands of
simultaneous hits as it is to make dozens (or hundreds) of registered
names of the same servlet and
distributing those same thousands of hits amongst those?
--Jim Preston
InterSurvey Inc.
___________________________________________________________________________
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