Memory Management
We rely heavily on Java's automatic memory management. When we allocate memory for an object or array using the keyword new, we don't think about where the memory comes from. When an object or array becomes unreachable, it magically disappears.
Some languages, notably C and C++, do not have automatic memory management. Section 16.1 discusses the alternative: explicit memory management. This is worth knowing, because we may be called upon to work in one of these languages some day, and because we can sometimes optimize a Java program by using explicit memory management.
Section 16.2 discusses the algorithms behind automatic memory management systems like Java's.
Explicit Memory Management
|