Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 43585 invoked from network); 17 Jul 2000 20:35:10 -0000 Received: from vortex.more.net (198.209.253.169) by locus.apache.org with SMTP; 17 Jul 2000 20:35:10 -0000 Received: from voyager.apg.more.net (b5fan.spg.more.net [207.160.133.142]) by vortex.more.net (8.9.3/8.9.3) with ESMTP id PAA21479 for ; Mon, 17 Jul 2000 15:35:09 -0500 (CDT) Sender: glenn@more.net Message-ID: <39736DFD.D72E6CE4@voyager.apg.more.net> Date: Mon, 17 Jul 2000 15:35:09 -0500 From: Glenn Nielsen Organization: MOREnet X-Mailer: Mozilla 4.7 [en] (X11; I; SunOS 5.7 i86pc) X-Accept-Language: en MIME-Version: 1.0 To: tomcat-dev@jakarta.apache.org Subject: Re: Sessions - Memory Constraints References: <002901bff02d$213291a0$6e14730a@dot.state.oh.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Shouldn't that be setAttribute() instead of setParameter if you want to add an object to the servlet context. Glenn James Cook wrote: > > Keep in mind that JSP is just an easy to use(?) extension built on top of > servlets. There is nothing done in JSP that can't be done in servlets. IMHO, > servlets are much easier to maintain, and have better separation of > presentation from business logic, when done properly. > > Off the soapbox... > > Application scope refers to the servlet's context. You can add objects to > the servlet's context using: > > getServletContext().setParameter() > > jim > > ----- Original Message ----- > From: "Doshi, Gunjan" > To: > Cc: > Sent: Monday, July 17, 2000 3:53 PM > Subject: RE: Sessions - Memory Constraints > > > Thanks for all the answers. > > APPLICATION_SCOPE as far as I know, is available only in JSPs. > Unfortunately > > I am using servlets. Can you set the application scope in servlets. > > > > Best Regards > > Gunjan > > > > > ---------- > > > From: Glenn Nielsen[SMTP:glenn@voyager.apg.more.net] > > > Reply To: tomcat-dev@jakarta.apache.org > > > Sent: Monday, July 17, 2000 3:43 PM > > > To: tomcat-dev@jakarta.apache.org > > > Subject: Re: Sessions - Memory Constraints > > > > > > Unless the object is something that scopes to the application, > > > then you can save it as APPLICATION_SCOPE and only have one instance > > > for all requests. > > > > > > If you are really concerned about memory/cpu usage by an application > > > you should profile it using one of the many fine profilers available > > > like OptimizeIt or JProbe. > > > > > > Glenn > > > > > > "Biju.Therakathilal (Exchange)" wrote: > > > > > > > > yes, there will be 1000 instances of the same object when there are > 1000 > > > > sessions active. Inorder to reduce the overhead for creating and > > > destroying > > > > these objects, object pooling used in some transaction servers like > > > MTS,a > > > > microsoft product. i think the same is there in EJB also. > > > > > > > > Biju > > > > > > > > -----Original Message----- > > > > From: Doshi, Gunjan [mailto:gunjan_doshi@merck.com] > > > > Sent: Monday, July 17, 2000 2:10 PM > > > > To: 'tomcat-dev@jakarta.apache.org' > > > > Subject: RE: Sessions - Memory Constraints > > > > > > > > Does that mean if I have 1000 users on my site resulting in 1000 > > > sessions > > > > and hence 1000 copies of my object kept in memory. > > > > > > > > This is a big overload. > > > > Best Regards > > > > Gunjan > > > > > > > > > ---------- > > > > > 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 > > > > > > > > > ---------------------------------------------------------------------- Glenn Nielsen glenn@more.net | /* Spelin donut madder | MOREnet System Programming | * if iz ina coment. | Missouri Research and Education Network | */ | ----------------------------------------------------------------------