How does Java handle memory management for unreachable objects?

Technical