Java Reference
In-Depth Information
Debugging applications
This chapter covers
Debugging bundles using jdb
Debugging bundles using Eclipse
Understanding and solving class-loading issues
Tr a c k i n g d o w n m e m o r y l e a k s a n d d a n g l i n g
service references
You just learned how to test individual bundles and application deployments in
OSG i, but what should you do when an integration test unexpectedly fails with a
class-loading exception or a load test runs out of memory? If you were working on a
classic Java application, you'd break out the debugger, start adding or enabling
instrumentation, and capture various diagnostic dumps. Well, an OSG i application
is still a Java application, so you can continue to use many of your well-honed
debugging techniques. The key area to watch out for is usually related to class load-
ing, but that's not the only pitfall.
OSG i applications can have multiple versions of the same class running at the
same time, requiring greater awareness of versioning; missing imports can lead to
groups of classes that are incompatible with other groups; and dangling services can
lead to unexpected memory leaks when updating bundles. In this chapter, we'll show
258
Search WWH ::




Custom Search