You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2012/08/07 12:47:42 UTC

svn commit: r1370162 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/config/ResourceLoader.java

Author: adrianc
Date: Tue Aug  7 10:47:41 2012
New Revision: 1370162

URL: http://svn.apache.org/viewvc?rev=1370162&view=rev
Log:
Added a warning comment to ResourceLoader.java. DOM object trees should not be kept in memory because they are big. Keep in mind the entire XML document is in the DOM tree - including comments, license headers, etc.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/config/ResourceLoader.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/config/ResourceLoader.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/config/ResourceLoader.java?rev=1370162&r1=1370161&r2=1370162&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/config/ResourceLoader.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/config/ResourceLoader.java Tue Aug  7 10:47:41 2012
@@ -89,6 +89,8 @@ public abstract class ResourceLoader {
         UtilCache.clearCachesThatStartWith(xmlFilename);
     }
 
+    // This method should be avoided. DOM object trees take a lot of memory, so they should
+    // not be cached.
     public static Document getXmlDocument(String xmlFilename) throws GenericConfigException {
         Document document = (Document) loaderCache.get(xmlFilename);