_windwalker_ (_windwalker_) wrote,

Speaking about soft references

I actually can think of one situation when one would like to maintain a soft reference to an object, but I don't like that default guideline for soft references is for cache.

The story is - if you can drop any entry (and all) of cache without negatively affecting application (and all entries will be removed by consecutive GCs) then you don't need cache.
If you applicaiton will be affected by cache eviction then you don't want GC affecting evictions, thus you don't want to use soft references.

Simple, huh ?
Tags: java
  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.