Permalink
Browse files

Make the classCacheMap be weak (so this is not a memory leak)

  • Loading branch information...
1 parent 5d856c1 commit 3ddb05813c626deae979e17ca01554d3aeabdd16 @krestenkrab committed May 6, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/kilim/analysis/AsmDetector.java
View
4 src/kilim/analysis/AsmDetector.java
@@ -1,6 +1,8 @@
package kilim.analysis;
import java.util.LinkedList;
+import java.util.Map;
+import java.util.WeakHashMap;
import java.io.IOException;
import java.util.HashMap;
@@ -14,7 +16,7 @@
* of trying to classload it.
*/
public class AsmDetector {
- static HashMap<String, ClassCache> classCacheMap= new HashMap<String, ClassCache>();
+ static Map<String, ClassCache> classCacheMap= new WeakValueHashMap<String, ClassCache>();
public static int getPausableStatus(String className, String methodName,
String desc, Detector detector)
{

0 comments on commit 3ddb058

Please sign in to comment.