Revision: 9717
Author: gwt.mirror...@gmail.com
Date: Thu Feb 10 11:10:49 2011
Log: Fixes memory leak in ResourceOracleImpl under GWT Designer.

While using GWT Designer the class path cache in ResourceOracleImpl never gets cleared of obsolete data.

http://gwt-code-reviews.appspot.com/1308801/show
Patch by: amitin
Review by: me

http://code.google.com/p/google-web-toolkit/source/detail?r=9717

Modified:
/trunk/dev/core/src/com/google/gwt/dev/resource/impl/ResourceOracleImpl.java

=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/resource/impl/ResourceOracleImpl.java Fri Jan 7 09:43:50 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/resource/impl/ResourceOracleImpl.java Thu Feb 10 11:10:49 2011
@@ -24,6 +24,9 @@
 import com.google.gwt.dev.util.msg.Message0;
 import com.google.gwt.dev.util.msg.Message1String;

+import org.apache.commons.collections.map.AbstractReferenceMap;
+import org.apache.commons.collections.map.ReferenceMap;
+
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -141,7 +144,9 @@
     }
   }

- private static final Map<ClassLoader, List<ClassPathEntry>> classPathCache = new HashMap<ClassLoader, List<ClassPathEntry>>();
+  @SuppressWarnings("unchecked")
+ private static final Map<ClassLoader, List<ClassPathEntry>> classPathCache = new ReferenceMap(
+      AbstractReferenceMap.WEAK, AbstractReferenceMap.HARD);

public static ClassPathEntry createEntryForUrl(TreeLogger logger, URL url)
       throws URISyntaxException, IOException {

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to