File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Performance and the fly likes Why we have WeakHashMap and not SoftHashMap Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Performance
Reply Bookmark "Why we have WeakHashMap and not SoftHashMap" Watch "Why we have WeakHashMap and not SoftHashMap" New topic
Author

Why we have WeakHashMap and not SoftHashMap

shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
Why we don't have SoftHashMap in java? In my opinion having SoftHashMap is more useful than having WeakHashMap. I want opinion, suggestions of ranchers.

This message was edited 2 times. Last update was at by shivendra tripathi



SCJP 1.5(97%) My Blog
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 13408


In the few cases, where I used weak references (or soft references), I used the classes, (and queues) directly. Never used the WeakHashMap class. So, never thought about the possibility of the SoftHashMap class. IMO, the WeakHashMap class was written for internal (as support) reasons, and then exposed because others may need it. Maybe that is why SoftHashMap was never written.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
Thanks Henry. I would appreciate more though from ranchers.
 
 
subject: Why we have WeakHashMap and not SoftHashMap
 
developer file tools