Author: nextgens
Date: 2007-03-30 09:38:11 +0000 (Fri, 30 Mar 2007)
New Revision: 12448

Modified:
   trunk/freenet/src/freenet/node/Node.java
Log:
Add a new check on the configCallback of node.databaseMaxMemory

Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java    2007-03-30 09:20:11 UTC (rev 
12447)
+++ trunk/freenet/src/freenet/node/Node.java    2007-03-30 09:38:11 UTC (rev 
12448)
@@ -1191,6 +1191,8 @@
                        public void set(long val) throws 
InvalidConfigValueException {
                                if(val < 0)
                                        throw new 
InvalidConfigValueException("Negative or zero values not supported");
+                               else if(val > (80 * 
Runtime.getRuntime().maxMemory() / 100))
+                                       throw new 
InvalidConfigValueException("Giving more than 80% of your ram to BDB is 
probably not what you want to do!");
                                envMutableConfig.setCacheSize(val);
                                try{
                                        
storeEnvironment.setMutableConfig(envMutableConfig);


Reply via email to