WeakHashMap
If you want the entry to be garbage collected, use WeakHashMap. Once the key is not strongly referenced, the entry will be automatically reclaimed.
Here is a good article to understand this:
http://www.codeinstructions.com/2008/09/weakhashmap-is-not-cache-understanding.html
posted on 2010-06-08 20:40 simplelove 閱讀(296) 評論(0) 編輯 收藏