Browse Source

Merge remote-tracking branch 'origin/candidate-3.8.x' into candidate-3.10.x

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 years ago
parent
commit
8d2fbdb6e6

+ 6 - 3
dali/sasha/saxref.cpp

@@ -25,6 +25,7 @@
 #include "sacmd.hpp"
 
 #define DEFAULT_MAXDIRTHREADS 500
+#define DEFAULT_MAXMEMORY 4096
 
 #define SDS_CONNECT_TIMEOUT  (1000*60*60*2)     // better than infinite
 #define SDS_LOCK_TIMEOUT 300000
@@ -673,8 +674,8 @@ public:
     bool verbose;
 
 
-    CNewXRefManager()
-        : mem(0x100000*1000,0x10000,true)
+    CNewXRefManager(unsigned maxMb=DEFAULT_MAXMEMORY)
+        : mem(0x100000*maxMb,0x10000,true)
     {
         iswin = false; // set later
         root = new cDirDesc(mem,"");
@@ -685,6 +686,7 @@ public:
         lostbranch.setown(createPTree("Lost"));
         orphansbranch.setown(createPTree("Orphans"));
         dirbranch.setown(createPTree("Directories"));
+        log("Max memory = %d MB", maxMb);
     }
 
     ~CNewXRefManager()
@@ -2084,7 +2086,8 @@ public:
             continue;
 #endif          
             const char *gname = groups.item(i);
-            CNewXRefManager manager;
+            unsigned maxMb = serverConfig->getPropInt("DfuXRef/@memoryLimit", DEFAULT_MAXMEMORY);
+            CNewXRefManager manager(maxMb);
             if (!manager.setGroup(cnames.item(i),gname,groupsdone,dirsdone)) 
                 continue;
             manager.start(updateeclwatch);

+ 7 - 0
initfiles/componentfiles/configxml/sasha.xsd

@@ -421,6 +421,13 @@
                 </xs:appinfo>
             </xs:annotation>
         </xs:attribute>
+        <xs:attribute name="memoryLimit" type="xs:nonNegativeInteger" use="optional" default="4096">
+            <xs:annotation>
+                <xs:appinfo>
+                    <tooltip>The upper memory limit that xref can use.</tooltip>
+                </xs:appinfo>
+            </xs:annotation>
+        </xs:attribute>
     </xs:attributeGroup>
     <xs:attributeGroup name="DfuExpiry">
         <xs:attribute name="ExpiryInterval" type="xs:nonNegativeInteger" default="24">

+ 3 - 0
initfiles/componentfiles/configxml/sasha.xsl

@@ -200,6 +200,9 @@
                       <xsl:with-param name="val" select="@xrefEclWatchProvider"/>
                    </xsl:call-template>
                 </xsl:attribute>
+                <xsl:attribute name="memoryLimit">
+                   <xsl:value-of select="@memoryLimit"/>
+                </xsl:attribute>
             </xsl:element>
             <xsl:element name="DfuExpiry">
                 <xsl:attribute name="interval">

+ 2 - 1
initfiles/etc/DIR_NAME/environment.xml.in

@@ -978,7 +978,8 @@
                       xrefCutoff="1"
                       xrefEclWatchProvider="true"
                       xrefInterval="0"
-                      xrefList="*">
+                      xrefList="*"
+                      xrefMaxMemory="4096">
    <Instance computer="localhost"
              directory="${RUNTIME_PATH}/mysasha"
              name="s1"