Anything that's set as a "global" variable in your Servlet should be relevant to the Servlet as a whole, and not specific to any one connection or session. The Container will create several instances of your Servlet object, and may very well NOT release those objects as time goes one (leaving the instances idle in a pool for more connections).
Any information stored in a Servlet has a lifespan far beyond each actual connection or session, so storing information in the Servlet may not be a particularly good idea. If you want to persist information for the length of a Request, then store the data as an attribute of the Request. Some thing for Sessions, and finally the actual ServletContext for items that need to live for the length of the Webapp. Remember that a single Session can have several Connections (each with individual Requests). Hope this helps. Regards, Will Hartung ([EMAIL PROTECTED]) ----- Original Message ----- From: "bin cai" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, August 12, 2002 9:53 AM Subject: Re: connection reset by peer, system slow down > Hi, Bhangale, > Thanks for your reply. > could you tell me what do you mean about leakage of > memory. You mean that i don't release some memory? > in my application, ther is 20 servlet. every servlet i > define connection as global variable. > Thanks again > bin > --- "Bhangale, Bhushan" <[EMAIL PROTECTED]> > wrote: > > The explaination you read about the message is > > right. > > > > There can be other factors which are making the > > system slow down. > > Check to see whether your application is using more > > memory than expected. > > There might be some leakage of memory. > > Also check for DB connections if you are using any. > > > > -----Original Message----- > > From: bin cai [mailto:[EMAIL PROTECTED]] > > Sent: Monday, August 12, 2002 11:58 AM > > To: [EMAIL PROTECTED] > > Subject: connection reset by peer, system slow down > > > > > > Hello, > > I got one serious problem. any help will be > > appreciated very much. Thanks in advance. > > my project is about online exam. students take exam > > through internet.This sytem is developed by java > > servlet, html, mysql and tomcat 3.2.3. Last Friday > > we > > have a test on my system. some students took the > > exam > > for half hour. > > It seemed ok. after exam, we (3 guys) had a further > > tesing on my system. we try to log to system using > > different login ids at the same machine. or using > > same > > loin id to log to sytem at different machines. but > > the > > sytem suddenly slow down. very slow. when i check > > the > > server, find the waning message like "socket > > exception....connection reset > > by peer. I read some documentation about this error. > > i was informed that the > > message will happen when client send another request > > before the previous > > request is returned. it will not hurt the > > performance. but in my case my > > system has slowed down obviously. any one can give > > me some hint? i will > > appreicate it very much. bin > > > > > ______________________________________________________________________ > > Post your ad for free now! http://personals.yahoo.ca > > > > > ___________________________________________________________________________ > > 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 > > > > > > "The information in this e-mail, and any attachment > > therein, is > > confidential and for use by the addressee only. If > > you are not the > > intended recipient, please return the e-mail to the > > sender and delete > > it from your computer. Although The Bank of New York > > attempts to > > sweep e-mail and attachments for viruses, it does > > not guarantee that > > either are virus-free and accepts no liability for > > any damage sustained > > as a result of viruses." > > > > > ___________________________________________________________________________ > > 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 > > > > > ______________________________________________________________________ > Post your ad for free now! http://personals.yahoo.ca > > ___________________________________________________________________________ > 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 > > ___________________________________________________________________________ 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
