File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Is phantomly reference  is  possible ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Is phantomly reference  is  possible ??" Watch "Is phantomly reference  is  possible ??" New topic

Is phantomly reference is possible ??

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234


I have read that

An object is phantomly reachable, it means the object already has been finalized but not yet reclaimed.

Could anybody please tell me , how this is possible ??

Save India From Corruption - Anna Hazare.
Stephan van Hulst

Joined: Sep 20, 2010
Posts: 4624

Because the designers made it to work. Is there anything specific you don't understand?

The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
Ove Lindström
Ranch Hand

Joined: Mar 10, 2008
Posts: 326

It is mainly a part of how the Garbage Collection and Java automatic memory management is working. If you don't have ANY references to an object it will be impossible to clean it out of the memory. It is also possible to reuse an object that might have been left for the GC to clean. One of those functions is when a piece of code is generating the same exception over and over again. The JVM might then choose to reuse the same Exception object and reclaim it from the GC.

To fully understand this, you should read up on Java memory management.
I agree. Here's the link:
subject: Is phantomly reference is possible ??
It's not a secret anymore!