

There is also a live chart on the lower part of the GUI, where memory and DOM usage can be viewed and the update speed can be configured to your liking, using one of the available presets. The commands are at hand, on the right side of the main window, where also the live statistics are displayed inside a table that is updated continuously. The interface is quite plain and somewhat crammed because the area reserved to the web browsing activity is not sufficient to hold the entire webpage unless the app is maximized. All you have to do is run the executable and start working on the spot. Getting this piece of kit up and running is a very simple task as there are no special requirements, not even a quick set up is needed. Uncomplicated front-end for advanced tasks One of the utilities that can be of assistance in such operations goes by the name of sIEve and is dedicated to handling memory leaks in Microsoft's proprietary web browser. Thereafter, we need to trigger the class loading sequence by connecting the debugger to the Tomcat instance and having the debugger come to a halt exactly at the point where the applications and especially their resource usage is a job that is carried out mostly by developers and programmers, who have the befitting tools for this type of activities. Right-click on the class name in the Outline pane and choose ‘Toggle Class Load Breakpoint’.Use the Open Type Command ( Shift+Control+T) to navigate to the type.Also, we need to set a class loader breakpoint on Then, we move on to remotely debug the class loading sequence – in which case I would be using Eclipse to do this.
LOGITECH GAMING FRAMEWORK MEMORY LEAK CODE
Now we figure out what instantiated the type, for starters.įirstly, we restart the Tomcat in debug mode with the following code export JPDA_SUSPEND=y $/bin/catalina.sh jpda Hence, this is the errant reference causing the memory leak. We could also see that the contextClassLoader field in AppContext is holding a reference to the WebappClassLoader. But in the event that there are more, then we have a leak.įrom this, we can deduce that this is an instance of the type. Wherefore, if our Tomcat instance has just a single web application deployed, then there should only be one instance of this class in the heap. In a Tomcat servlet, a class loader for a web application is also a class called .WebappClassLoader. This tool is called the VisualVM which is a graphical tool that seamlessly connects to any JVM and allows you to expel unwanted garbage from the JVM’s heap besides letting you navigate that heap. With the advent of the Java Development Kit – JDK6 (Update 7 or later), comes a handy tool that ships with the JDK and makes life a whole lot easier for us. This gets a little more interesting when the Tomcat servlet isn’t causing the leak, neither is the application (at least not directly) but rather a bug in the JRE code triggered by some third-party library. Nonetheless, the inclusion of this memory leak handler wouldn’t suffice in the event of a more sophisticated such as PermGen errors on reload and bug interference caused by the application itself. In simple terms it is an exclusive heap location separate from the primary Java heap, where the JVM registers metadata related to the classes which have been loaded.Īlthough, most Java Servlet containers and WebSocket technologies enable the .JreMemoryLeakPreventionListener Class by extension such as Apache Tomcat 7.0 and upwards. PermGen, short for Permanent Generation is a heap in the JVM dedicated to storing the JVM’s internal representation of Java Classes – and also detained string instances. These references often remain even after a web application is reloaded and with each new reload, more classes get pinned or stuck up in the PermGen – which in due course gets full. Therefore, retaining a reference to a particular object from a web application pins every class loaded by the web application in the PermGen. Not to forget that these classes are loaded directly into the PermGen.

This potentially becomes a very big reference graph to handle on a long run.
