|
Pump Up Your Technical Knowledge
Listen and watch as industry luminaries bring you the latest on Java technologies
Developers often ask this session's speakers for advice on how to write code that is more garbage-collection-friendly. Most of the time, their advice is: don't believe the urban myths, and don't do anything special, because trying to be smart is likely to confuse, instead of help, garbage collectors. Having said that, over the years, they have developed a small set of rules of thumb they give customers to help them with garbage-collection-related issues. This presentation summarizes them. It starts with a very brief overview of garbage-collection terminology, to refresh the audience's memory. The overview covers only concepts that are touched on during the session, including the characteristics of generational and incremental garbage collectors. The remainder of the presentation is split into three sections: Section 1: General advice--This section covers some general programming advice on how not to get in the way of the garbage collector, such as the following:
The next two sections cover garbage-collection-related features of the Java programming language. Section 2: Finalizers--Blind use of finalization can put unnecessary load on the garbage collector. This section covers traps a programmer can easily fall into when using finalization and how to avoid such traps. Section 3. References--This section gives an overview of the three reference types of the Java programming language, advises which type to use when, and illustrates different usage patterns. Wherever possible, concrete demos illustrate pathologies in programs that stress the GC and show how they can be rectified.
Watch The Session |
FREE White Papers on Java SE, Java EE, cloud computing and database technologies.
| ||||||
|
| ||||||||||||