protected final void clearSerializationCaches(){
  try {
    clearSerializationCache(Class.forName("java.io.ObjectInputStream$Caches"),"subclassAudits");
    clearSerializationCache(Class.forName("java.io.ObjectOutputStream$Caches"),"subclassAudits");
    clearSerializationCache(Class.forName("java.io.ObjectStreamClass$Caches"),"localDescs");
    clearSerializationCache(Class.forName("java.io.ObjectStreamClass$Caches"),"reflectors");
  }
 catch (  ClassNotFoundException e) {
    if (log.isDebugEnabled())     log.debug("Class not found: " + e.getMessage());
  }
catch (  NoSuchFieldException e) {
    if (log.isDebugEnabled())     log.debug("Field not found: " + e.getMessage());
  }
catch (  IllegalAccessException e) {
    if (log.isDebugEnabled())     log.debug("Field can't be accessed: " + e.getMessage());
  }
}

protected final void clearSerializationCaches ( ) { try { clearSerializationCache ( Class . forName ( "java.io.ObjectInputStream$Caches" ) , "subclassAudits" ) ; clearSerializationCache ( Class . forName ( "java.io.ObjectOutputStream$Caches" ) , "subclassAudits" ) ; clearSerializationCache ( Class . forName ( "java.io.ObjectStreamClass$Caches" ) , "localDescs" ) ; clearSerializationCache ( Class . forName ( "java.io.ObjectStreamClass$Caches" ) , "reflectors" ) ; } catch ( ClassNotFoundException e ) { if ( log . isDebugEnabled ( ) ) log . debug ( "Class not found: " + e . getMessage ( ) ) ; } catch ( NoSuchFieldException e ) { if ( log . isDebugEnabled ( ) ) log . debug ( "Field not found: " + e . getMessage ( ) ) ; } catch ( IllegalAccessException e ) { if ( log . isDebugEnabled ( ) ) log . debug ( "Field can't be accessed: " + e . getMessage ( ) ) ; } }
clears serialization caches to avoid permgen memory leaks . this method should be called on each undeployment . < p > for more information : http : / / www . szegedi . org / articles / memleak3 . html .
