O'Reilly logo

Beginning Java 8 Language Features: Lambda Expressions, Inner Classes, Th reads, I/O, Collections,and Streams by Kishori Sharan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 11

image

Garbage Collection

In this chapter, you will learn

  • What garbage collection is
  • How garbage collection is implemented in Java
  • How to pass a hint to the JVM to run the garbage collector
  • How to implement the finalizers
  • Different states of an object based on its reachability and finalization status
  • The difference between strong and weak references
  • How to use weak references to implement memory-sensitive cache

What Is Garbage Collection?

In a programming language, memory management is central to the development of a fast, efficient, and bug-free application. Memory management involves two activities:

  • Memory allocation
  • Memory reclamation ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required