It is not always a memory leak that causes "OutOfMemoryError". A memory leak is a situation when some application, for example JVM allocates some amount of memory and then loses pointers to that area. So, the allocated area becomes a "black box" which you can not access and you need a key to open it. It is very rare situation when some Java code causes memory leaks. They are reported and can be found at "Bug parade" on SUN's web site.
"OutOfMemoryError" often caused by bad design. It can be for example: 1. Your program trying to process too much data. Increase the amount of memory or decrease the amount of data to be processed. Actually you can do it in a wise way: control how much memory left and if it less than, let say 20 %, decrease the processing speed. It was described in one of our tips while ago... 2. Your program holding too many objects and then program is running out of memory. You need to use close methods if you do need them. You can even explicitly set a reference to null to speed up garbage collection. 3. You use too many objects with finalizers... They consume your memory before you get any chance to run them... But most of the times, i have come to conclusion, its due to bad designing of applications which further coz memory leaks. Keeping the other factors in mind can help you solve ur problem. > -----Original Message----- > From: Daniel [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 03, 2003 11:37 AM > To: [EMAIL PROTECTED] > Subject: java.lang.OutOfMemoryError > > > Hi I am getting this error in tomcat. > > What should I do to get rid of this? > > > > ERROR!: > ************************************************** > Message: java.lang.OutOfMemoryError > Attributes: > javax.servlet.error.servlet_name=jsp > javax.servlet.error.exception=javax.servlet.ServletException > javax.servlet.error.request_uri=/mori/jsp/events/view/viewAll.jsp > javax.servlet.error.status_code=500 > javax.servlet.error.exception_type=class > javax.servlet.ServletException > javax.servlet.jsp.jspException=java.lang.OutOfMemoryError > null > java.lang.OutOfMemoryError > > ============================================================== > ============= > To unsubscribe: mailto [EMAIL PROTECTED] with body: > "signoff JSP-INTEREST". > For digest: mailto [EMAIL PROTECTED] with body: "set > JSP-INTEREST DIGEST". > Some relevant FAQs on JSP/Servlets can be found at: > > http://archives.java.sun.com/jsp-interest.html > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.jsp > http://www.jguru.com/faq/index.jsp > http://www.jspinsider.com > Disclaimer: This e-mail message along with any attachments is intended only for the addressee and may contain confidential and privileged information of GTL Limited. If the reader of this message is not the intended recipient, you are notified that any dissemination, distribution or copy of this communication is strictly prohibited. If you have received this message by error, please notify us immediately, return the original mail to the sender and delete the message from your system. =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com