ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button

Profiling Your Applications with Eclipse Callisto
Pages: 1, 2, 3, 4

The profiling tool may take some time to run, depending on how big your test cases are. Once done, Eclipse will display a Profiling Monitor view, from which you can display details of the results of each type of profiling (see Figure 5).



The profile results.
Figure 5: The profile results

The Memory Statistics view displays the number of objects created by the application. The results can be organized by package (in the form of a tree view), or as a list of classes or instances. This data can give you an idea of how many objects of each type are being created; unusually high numbers of created objects (especially high-level objects such as domain objects) should be treated with suspicion.

Another useful tool for detecting memory leaks is the Object References view. To obtain this data, you need to activate reference collecting. After you start the profiling, click on the monitoring entry and select Collect Object References in the contextual menu (see Figure 6). Then open the Object References view via the contextual menu (Open with -> Object References). You will obtain a list of classes with the number of references to each class. This can provide some clues concerning possible memory leaks.

The profile results.
Figure 6: Activating reference collection

The Execution Statistics view, shown in Figure 7, gives a good view of where your application is spending its time. The "organization by" package lets you drill down to the classes and methods that are taking the most time to execute. Clicking on a method will open the Method Invocation Details view, which displays some finer details on the number of times the method is being called, where it is being called from, and what other methods it itself invokes. Although this view is not as well integrated into the source-code views as some of the commercial tools (where it is possible to drill down into the source code itself), it can give some vital clues to which methods may be performing badly.

The Execution Statistics view.
Figure 7: The Execution Statistics view

Pages: 1, 2, 3, 4

Next Pagearrow