>>> Jim Preston <[EMAIL PROTECTED]> 4/28/99 8:13:40 PM >>>
I'm not sure I'm a guru but here are some answers:

>Do I assume correctly that objects stored in the session object are
kept
>around in memory (the
>servlet engine's memory, the JVM's?)?

Yes.

> 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?

No, you're next point covers this.

Explanation: You only put references in the session.

This ensures the data hangs around but the server is only going to
"go down" if you run out of memory. Even then a good servlet engine
should just carry on and either GC or let the servlets know that
they've run out of memory (ie: throw OutOfMemoryException a lot).

> 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?

Yes. Not pointers, references. Java not C.

>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?

There are no inherant trade offs.

But I suspect you are going to need more data with lots of servlets
to distinguish which MassiveObject to load.

I think you're getting worried with no reason about big objects.

Think about fairly sizable file caches, they are done quite a lot
with servlets (ie: cache a whole web site).

>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?

Pretty much. The path mappings for the servlets would have an
effect.

Less long path maps should take slightly longer for the servlet
engine to find in it's list.

But this is a tiny effect.

It is still better to have 1 servlet for 1 type of request however.

Apart from anything it's tidier.

And who is going to load and map all these servlets?



Nic Ferrier
Tapsell-Ferrier Ltd
www.tapsellferrier.co.uk

___________________________________________________________________________
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