tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doshi, Gunjan" <gunjan_do...@merck.com>
Subject FW: Sessions - Memory Constraints
Date Mon, 17 Jul 2000 20:22:24 GMT
Craig:
> If each user gets a reference to the same object instance, and stores that
> in
> their session, then there is only one object.
> 
The only way I can think of sharing the object instance among all the
sessions is by using singleton pattern or making the object static, final.

In rest of the cases like 

String strParam = request.getParameter("Test");
session.putValue( "param", strParameter);
 there will be a instance of the string object strParam per session.

THanks 
Gunjan

> This all a fundamental characteristic of how objects work in Java (and in
> other
> languages like C++ when you use pointers or references).  There is nothing
> magic about sessions.
> 
> >
> > This is a big overload.
> 
> It all depends on your needs.
> 
> If you need to keep things for each user in between requests, that is what
> a
> session is for, and you need to ensure that your server has enough memory
> to
> meet your needs -- just like you need to make sure it's CPU is fast enough
> to
> perform the required computations.  If you do not need to retrieve
> something
> from a previous request, you should not put that object into the session
> in the
> first place.
> 
> 
> >
> > Best Regards
> > Gunjan
> >
> 
> Craig McClanahan
> 
> 
> >
> > > ----------
> > > From:         Biju.Therakathilal
> > > (Exchange)[SMTP:Biju.Therakathilal@target.com]
> > > Reply To:     tomcat-dev@jakarta.apache.org
> > > Sent:         Monday, July 17, 2000 2:38 PM
> > > To:   'tomcat-dev@jakarta.apache.org'
> > > Subject:      RE: Sessions - Memory Constraints
> > >
> > > When you put an object in session, the whole object is kept in memory.
> > > Normal objects doesn't have persistence capability. So the only way is
> to
> > > keep it in momory.
> > >
> > > Biju
> > >
> > > -----Original Message-----
> > > From: Doshi, Gunjan [mailto:gunjan_doshi@merck.com]
> > > Sent: Monday, July 17, 2000 1:33 PM
> > > To: 'tomcat-dev@jakarta.apache.org'
> > > Subject: Sessions - Memory Constraints
> > >
> > >
> > > Friends:
> > > When you put a object in the session, does that mean the whole object
> is
> > > loaded in the memory.
> > >
> > > Because if the whole object is stored in the memory, then the chances
> of
> > > reaching the peak and getting out of memory errors are high.
> > >
> > > Example: Say I have a image and I need to put that in the session.
> Does
> > > that
> > > mean the whole Image object gets stored in the memory for each session
> > > created.
> > >
> > > Or is it that only the reference to the object is loaded in the
> memory.
> > >
> > > Best Regards
> > > Gunjan
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 

Mime
View raw message