Memory Leak in Java
Java has by definition no memory leaks [think automatic garbage collection]. What leaks memory is running software, especially long running enterprise software, such as that on a web application server.
The picture below shows a memory leak of a Tomcat web application that reads from ActiveMQ messaging system and does a bulk insert into a database. The memory graph, snapshot from the JMX console, rises over 9 hours close to 800 MB before it throws periodic OutOfHeapSpace exceptions. The Tomcat instance was run with -Xmx1024m. Tomcat uses the rest for itself. This measurement was taken under the conditions of a stress test; it levels out at 800 MB after 9 hours. In production, where JMX is turned off, the OutOfHeapSpace error took a week or so to show up.
How to find the root of the leak
In my case, the leak was caused by a JDBC database driver, JConn v6, for reasons I don’t really bother to know. Replacing that JDBC driver with the open-source jDTS driver for Sybase and SQLServer brought down memory consumption to 20MB and made it run faster. A nagging problem was solved.

?????????, ??? ????? ?? ???? ??????. ???????, ??? ????? ???????. ?? ????????????….
?????????? The picture below shows a memory leak of a Tomcat web application that reads from ActiveMQ messaging system and does a bulk insert into a database. […….
Trackback by Kylie Batt — May 4, 2010 @ 11:44 am
? ???? ???-?? ????. ??????? ?? ?????? ? ???? ???????. ? ?? ???? ?????….
??????? ????????? ??????? ?????? 1 ????????? ??????? Java has by definition no memory leaks [think automatic garbage collection]…..
Trackback by Kylie Batt — May 19, 2010 @ 1:30 pm