HashMap with weak values

前端 未结 7 2344
悲&欢浪女
悲&欢浪女 2021-02-18 14:03

I\'m implementing a cache for Objects stored persistently. The idea is:

  • Method getObjectFromPersistence(long id); ///Takes about 3 seconds
  • M
7条回答
  •  灰色年华
    2021-02-18 14:34

    You can also test WeakValueHashMap from jboss-common http://docs.jboss.org/jbossas/javadoc/4.0.2/org/jboss/util/collection/WeakValueHashMap.java.html

提交回复
热议问题