_windwalker_ (_windwalker_) wrote,
_windwalker_
_windwalker_

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
Subscribe
  • Post a new comment

    Error

    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.
  • 0 comments