What Is Garbage Collection?

During the course of a Java program's (or applet's or servlet's) execution, the program might create and use many different objects. Each object takes up some amount of valuable memory space and possibly other resources, such as windows or communication buffers. Although the memory and other resources that each individual object takes up might be negligible, when viewed collectively, the resource drain might be significant. A program might become unable to perform its processing because it needs memory and operating system resources that are no longer available.

NOTE

Applets and Garbage Collection Although this chapter's discussion is oriented toward Java programs, it applies equally as well to applets and servlets. ...

Get Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.