Philadephia Area Java Users' Group

"Java Reference Objects" by Keith Gregory

Sponsored by GSI Commerce

Abstract
Have your programs ever failed due to an OutOfMemoryError? Has one ever taken down an app-server?

The java.lang.ref package, introduced with JDK 1.2 but still little used, is there to help. Its soft and weak reference objects provide developers a way to make objects available for garbage collection while still being used, and its phantom references provide a better alternative to object finalizers.

This presentation examines all three types of reference objects, in the context of the object life cycle. We discuss when it’s appropriate to use each, with examples. At the end, you’ll be prepared to tell the JVM “here, take my memory, just don’t kill my program.”

Speaker Bio
Keith Gregory has been in the software industry for 24 years, working on a wide variety of projects: from writing the drivers for one of the first PC faxmodems, to writing SQL for a massively parallel database as “Manager of Ad Hoc Programming” at Fidelity Investments. Currently he is a Technical Lead in the Web Technologies group at GSI Commerce.

NOTE: This jarfile below contains both the presentation and a directory containing the example code. It doesn’t have a build script, but is set up as an Eclipse project; I’m assuming that readers will want to examine the examples, not simply run them.

Download:

file: reference_objects.jar [186.01KB]