SoftReference are good way to implement memory efficient cache as the
Java Specification says that Garbage collector will clear all soft references before throwing OutofMemoryError.
Code will definitely become more complex then a simple HashMap cache, so if you are going to build a really memory consuming cache then you can utilize a SoftReference based cache.
Here is an example of [
Cache Using SoftReference ]
There are more ways to implement reference queue clean up logic. May be other people on forum can also give input on the same.