Spork Code

Code. Randomness. Sporks.

Weak References in Java: Working around the Garbage Collector

with 2 comments

Weak References are a slightly obscure, but extremely useful, feature of Java. They effectively give you a reference to an object that is ignored by the garbage collector! What does this mean? This means that if an object only has weak references pointing at it, it is eligible for GC. Weak references come in three types: WeakReference, SoftReference, and PhantomReference. Now, I could give you a detailed analysis of all of these types, but instead I will point you to the very well written blog post by Ethan Nicholas.

Read away!

Advertisements

Written by John Gunderman

July 10, 2009 at 7:02 pm

Posted in Uncategorized

2 Responses

Subscribe to comments with RSS.

  1. Hi webmaster do you need unlimited content for your
    page ? What if you could copy content from other blogs,
    make it pass copyscape test and publish on your website – i know the right
    tool for you, just search in google:
    loimqua’s article tool

    Gilda

    January 15, 2015 at 2:12 am

  2. If you are interested in topic: earn extra money online in south africa – you should
    read about Bucksflooder first

    Dianne

    September 12, 2016 at 9:02 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: