/** * Clear all optional cached data associated with this class */ public void clearSoftCaches() { // toss optional information from each method. if (methodMap != null) { for (IMethod iMethod : getDeclaredMethods()) { ShrikeCTMethod m = (ShrikeCTMethod) iMethod; m.clearCaches(); } } // clear the methodMap cache // SJF: don't do this!!! makes it hard to clear caches on methods. // methodMap = null; inheritCache = null; // clear the cached interfaces allInterfaces = null; // toss away the Shrike reader reader.clear(); }
/** * Clear all optional cached data associated with this class */ public void clearSoftCaches() { // toss optional information from each method. if (methodMap != null) { for (IMethod iMethod : getDeclaredMethods()) { ShrikeCTMethod m = (ShrikeCTMethod) iMethod; m.clearCaches(); } } // clear the methodMap cache // SJF: don't do this!!! makes it hard to clear caches on methods. // methodMap = null; inheritCache = null; // clear the cached interfaces allInterfaces = null; // toss away the Shrike reader reader.clear(); }
/** * A debugging aid. TODO: move this elsewhere */ public static void clearSoftCaches() { float occupancy = 1f - ((float)Runtime.getRuntime().freeMemory() / (float)Runtime.getRuntime().totalMemory()); if (occupancy < OCCUPANCY_TRIGGER) { return; } AnalysisCacheImpl cache = getAnalysisCache(); if (cache != null) { cache.getSSACache().wipe(); } IClassHierarchy cha = getClassHierarchy(); if (cha != null) { for (IClass klass : cha) { if (klass instanceof ShrikeClass) { ShrikeClass c = (ShrikeClass) klass; c.clearSoftCaches(); } else { if (klass.getDeclaredMethods() != null) { for (IMethod m : klass.getDeclaredMethods()) { if (m instanceof ShrikeCTMethod) { ((ShrikeCTMethod)m).clearCaches(); } } } } } } }
/** * A debugging aid. TODO: move this elsewhere */ public static void clearSoftCaches() { float occupancy = 1f - ((float)Runtime.getRuntime().freeMemory() / (float)Runtime.getRuntime().totalMemory()); if (occupancy < OCCUPANCY_TRIGGER) { return; } AnalysisCacheImpl cache = getAnalysisCache(); if (cache != null) { cache.getSSACache().wipe(); } IClassHierarchy cha = getClassHierarchy(); if (cha != null) { for (IClass klass : cha) { if (klass instanceof ShrikeClass) { ShrikeClass c = (ShrikeClass) klass; c.clearSoftCaches(); } else { if (klass.getDeclaredMethods() != null) { for (IMethod m : klass.getDeclaredMethods()) { if (m instanceof ShrikeCTMethod) { ((ShrikeCTMethod)m).clearCaches(); } } } } } } }