The attached class implements an auxiliary cache using Google Collection API 1.0. This class can be used as replacement of the existing /com.ibm.wala.core/src/com/ibm/wala/ssa/AuxiliaryCache.java and makes ReferenceCleanser obsolet. For quick test simply change SSACache#irCache and SSACache#duCache as follows:
class SSACache {
final private AuxiliaryCache2<IR> irCache = new AuxiliaryCache2<IR>();
final private AuxiliaryCache2<DefUse> duCache = new AuxiliaryCache2<DefUse>();
...
}
= Advantage over AuxiliaryCache =
No need for calling reset() every 2k elements or generally calling ReferenceCleanser.clearSoftCaches(). The VM automatically discards unused references (typically) using LRU strategy.
= Discussion Thread =
https://sourceforge.net/mailarchive/forum.php?thread_name=OF234814AF.A357AE0E-ON852576D5.007345F4-852576D5.007345F9%40us.ibm.com&forum_name=wala-wala
= Link to used 3rd party =
com.google.common.collect.MapMaker: see http://google-collections.googlecode.com/svn/trunk/javadoc/com/google/common/collect/MapMaker.html
AuxiliaryCache using SoftReferences