hi friendezzz, i am running an application on sun solaris using tomcat which is based on the MVC architecture. Yesterday, it encountered an java.lang.OutOfMemoryError, which i couldnot trace.. it showed something like this.. 2002-05-07 14:18:36 - DecodeInterceptor: Charset from session ISO-8859-1 ThreadPool: Caught exception executing org.apache.tomcat.util.net.TcpWorkerThread@ce93ef, terminating thread java.lang.OutOfMemoryError Please can anyone help on this.? under what circumstances would this happen and how to avoid this memory leak (if it actually is memory leak!! ) problem... Thanx in advance.. Chhaya 2002-05-07 14:18:36 - DecodeInterceptor: Charset from session ISO-8859-1
Chhaya Dhanani
Ranch Hand
Joined: Apr 11, 2001
Posts: 70
posted
0
hi all, Can no one answer that query of mine.. not even the moderators or bartenders... Chhaya
Juanjo Bazan
Ranch Hand
Joined: Feb 04, 2002
Posts: 231
posted
0
Do you use Connection objects? If so, make sure that the Connections used in the application is properly returned to the pool after use and is killed when the load on the server goes less. This will give an optimum performance and reduce the memory being eaten up by the server.
Anthony Villanueva
Ranch Hand
Joined: Mar 22, 2002
Posts: 1055
posted
0
If your servlets or JSP pages have any problems and you see "java.lang.OutOfMemoryError" in your log files or in a stack trace generated by the Java Virtual Machine (JVM), then you probably need to increase the JVM's maximum heap size. Each instance of a Java Virtual Machine uses an allocation of memory for all objects, shared among all its threads, called the heap. The default size and some of the features of the heap's behavior are implementation dependent, but most (if not all) implementations allow you to modify the heap's minimum and maximum size, and most provide a default value for these settings. What setting you choose should be determined by testing and trial and error. It is highly application and load dependent. You should not try to catch OutOfMemoryErrors in your application. They are not generally predictable. And when they do happen, there's nothing to be done to recover, because by then the JVM is out of memory and the garbage collector is unable to free any memory for further work.
Jim Baiter
Ranch Hand
Joined: Jan 05, 2001
Posts: 530
posted
0
If you really can't resolve this any other way you should consider using a profiler such as JProbe. This will tell you which objects are consuming the memory.