Svoboda | Graniru | BBC Russia | Golosameriki | Facebook

To install click the Add extension button. That's it.

The source code for the WIKI 2 extension is being checked by specialists of the Mozilla Foundation, Google, and Apple. You could also do it yourself at any point in time.

4,5
Kelly Slayton
Congratulations on this excellent venture… what a great idea!
Alexander Grigorievskiy
I use WIKI 2 every day and almost forgot how the original Wikipedia looks like.
Live Statistics
English Articles
Improved in 24 Hours
Added in 24 Hours
Languages
Recent
Show all languages
What we do. Every page goes through several hundred of perfecting techniques; in live mode. Quite the same Wikipedia. Just better.
.
Leo
Newton
Brights
Milds

Phantom reference

From Wikipedia, the free encyclopedia

A phantom reference is a kind of reference in Java, where the memory can be reclaimed. The phantom reference is one of the strengths or levels of 'non strong' reference defined in the Java programming language; the others being weak and soft.[1] Phantom reference are the weakest level of reference in Java; in order from strongest to weakest, they are: strong, soft, weak, phantom.

An object is phantomly referenced after it has been finalized.

In Java 8 and earlier versions, the reference needs to be cleared before the memory for a finalized referent can be reclaimed. A change in Java 9[2] will allow memory from a finalized referent to be reclaimable immediately.

YouTube Encyclopedic

  • 1/3
    Views:
    3 558
    3 490
    7 192
  • Java Weak Reference and Soft References
  • Java References
  • Advanced Topics in Programming Languages: Java Puzzlers, Episode VI

Transcription

Use

Phantom references are of limited use, primarily narrow technical uses.[3] First, it can be used instead of a finalize method, guaranteeing that the object is not resurrected during finalization. This allows the object to be garbage collected in a single cycle, rather than needing to wait for a second GC cycle to ensure that it has not been resurrected. A second use is to detect exactly when an object has been removed from memory (by using in combination with a ReferenceQueue object), ensuring that its memory is available, for example deferring allocation of a large amount of memory (e.g., a large image) until previous memory is freed.

See also

References

  1. ^ "java.lang.ref (Java Platform SE 8 )". Java™ Platform, Standard Edition 8 API Specification. Oracle. Retrieved 6 August 2016.
  2. ^ oracle.com, kim barrett at (28 December 2015). "hg: jdk9/hs-rt/jdk: 8071507: (ref) Clear phantom reference as soft and weak references do".
  3. ^ Nicholas, Ethan (May 4, 2006). "Understanding Weak References". www.java.net. Archived from the original on August 19, 2010. Retrieved October 1, 2010.


This page was last edited on 27 September 2019, at 10:23
Basis of this page is in Wikipedia. Text is available under the CC BY-SA 3.0 Unported License. Non-text media are available under their specified licenses. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. WIKI 2 is an independent company and has no affiliation with Wikimedia Foundation.