Mark: all the ones we know about! there are probably a few rarely encountered bugs remaining. the combination of these fixes and workarounds became the new memory leak protection features that will be included in tomcat 7 and has recently been back-ported to tomcat 6.0.x (6.0.24 onwards).ĭzone: so have all of the bugs causing memory leaks on tomcat's end been fixed? The memory leak protection was enhanced by taking a number of web applications known to have memory leaks on reload and developing fixes and workarounds for each of the memory leaks found until the applications could be reloaded without triggering a memory leak. that became the starting point for the new memory leak protection. as we worked to develop fixes for these, i realised that these fixes would be best placed as part of the standard tomcat codebase. however, we also traced some leaks to usage of particular standard java apis and this was a surprise. The leaks that were traced to application or library bugs weren't unexpected. this comment generated rather more feedback than i was expecting and i was soon working with a number of the attendees debugging their memory leaks. Historically, tomcat has been blamed for causing these memory leaks but when investigated by the tomcat developers, it usually emerged that the root cause was a bug in the web application or the library rather than tomcat.Īround twelve months ago i was giving a presentation on tomcat tuning and made an off-hand comment that the root cause of memory leaks on web application reload was application and/or library bugs rather than a tomcat bug. since then there have been a few edge case bugs that occasionally caused problems and, again, these were fixed as they were found. there were a handful of such bugs fixed around the time of tomcat 4.1.x / tomcat 5.5.x that regularly caused problems. where the problem has been traced to a bug in the tomcat code base, it has been fixed. Mark: memory leaks on web application reload have been a problem for as long as i have been involved in the tomcat project. To prevent the oome, it is necessary to ensure that nothing retains a reference to the web application class loader.ĭzone: tell me about the tomcat's history with memory leaks on web application reload. since permgen is limited in size, this usually only has to happen a few times before all the permgen is used. however, if something retains a reference to the web application class loader, it won't be garbage collected and the classes it loaded will remain in permgen. this normally happens after a web application stops. classes are removed from permgen when the class loader is collected by the garbage collector. a web application also gets a new class loader when it is reloaded. each web application has its own class loader this allows different versions of the same class (with the same name) to be used in different web applications without conflict. classes are stored in permgen using class name and class loader as the unique identifier. Mark thomas: the usual symptom observed is an outofmemoryerror (oome) indicating that the permanent generation (permgen) is exhausted when reloading a web application. in this exclusive interview with dzone, thomas elaborates on these fixes coming in the next version of apache tomcat.ĭzone: what typically causes a memory leak on web application reload and what symptoms might a developer see? now the challenge has been to come up with workarounds for the vast array of memory leak sources. he said that a small percentage of the leaks were caused by tomcat, but those bugs were fixed several years ago. in his overview of the features coming in tomcat 7, thomas said that the new version, which is expected to have an alpha release next month, will address many of the memory leaks caused by web applications, their libraries, and even the jvm. this topic could easily fill its own article, he said. The last time dzone spoke with mark thomas, a senior software engineer with springsource and committer for apache tomcat, he said that tomcat has had a long history of memory leaks when reloading web applications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |