directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1624283 - /directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
Date Thu, 11 Sep 2014 13:22:46 GMT
Author: kayyagari
Date: Thu Sep 11 13:22:46 2014
New Revision: 1624283

URL: http://svn.apache.org/r1624283
Log:
fix for preventing OOM issues while importing large number of entries (DIRSERVER-2002)

Modified:
    directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java?rev=1624283&r1=1624282&r2=1624283&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
(original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
Thu Sep 11 13:22:46 2014
@@ -200,7 +200,15 @@ public class JdbmPartition extends Abstr
                 LOG.debug( "Using the custom configured cache size of {} for {} partition",
cacheSize, id );
             }
 
-            recMan = new CacheRecordManager( base, new MRU( cacheSize ) );
+            // prevent the OOM when more than 50k users are loaded at a stretch
+            // adding this system property to make it configurable till JDBM gets replaced
by Mavibot
+            String cacheSizeVal = System.getProperty( "jdbm.recman.cache.size", "2000" );
+            
+            int recCacheSize = Integer.parseInt( cacheSizeVal );
+            
+            LOG.info( "Setting CacheRecondManager's cache size to {}", recCacheSize );
+            
+            recMan = new CacheRecordManager( base, new MRU( recCacheSize ) );
 
             // Create the master table (the table containing all the entries)
             master = new JdbmMasterTable( recMan, schemaManager );



Mime
View raw message