From 0c04328d7c86a6b2d4badb96c79a22aba2fa7eca Mon Sep 17 00:00:00 2001
From: dugan <dugan@localhost>
Date: Fri, 16 May 2008 14:18:26 +0000
Subject: [PATCH] Fixes to  improve performance using default JVM ergonomics:

---
 opends/src/server/org/opends/server/backends/jeb/importLDIF/Importer.java |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/opends/src/server/org/opends/server/backends/jeb/importLDIF/Importer.java b/opends/src/server/org/opends/server/backends/jeb/importLDIF/Importer.java
index 8c9b3e2..9464a18 100644
--- a/opends/src/server/org/opends/server/backends/jeb/importLDIF/Importer.java
+++ b/opends/src/server/org/opends/server/backends/jeb/importLDIF/Importer.java
@@ -178,11 +178,11 @@
     // Create one set of worker threads/buffer managers for each base DN.
     for (DNContext context : importMap.values()) {
       BufferManager bufferManager =
-                        new BufferManager(memoryPerContext, importThreadCount);
+                        new BufferManager(memoryPerContext);
       context.setBufferManager(bufferManager);
       for (int i = 0; i < importThreadCount; i++) {
         WorkThread t = new WorkThread(context.getWorkQueue(), i,
-                bufferManager, rootContainer);
+                bufferManager, rootContainer, importMap);
         t.setUncaughtExceptionHandler(this);
         threads.add(t);
         t.start();
@@ -557,6 +557,15 @@
     msg = NOTE_JEB_IMPORT_LDIF_FINAL_CLEAN.get();
     //Run the cleaner.
     runCleaner(msg);
+    closeIndexCursors();
+  }
+
+
+   private void closeIndexCursors() throws DatabaseException {
+    for (DNContext ic : importMap.values())
+    {
+      ic.getEntryContainer().closeIndexCursors();
+    }
   }
 
   /**
@@ -776,11 +785,11 @@
     long maxMemory = runtime.maxMemory();
     long totMemory = runtime.totalMemory();
     long totFreeMemory = (freeMemory + (maxMemory - totMemory));
-    long dbCacheLimit = (totFreeMemory * 45) / 100;
-    //If there are now substring indexes defined, set the DB cache
-    //size to 60% and take a minimal substring buffer.
+    long dbCacheLimit = (totFreeMemory * 60) / 100;
+    //If there are no substring indexes defined, set the DB cache
+    //size to 75% and take a minimal substring buffer.
     if(!hasSubIndexes) {
-      dbCacheLimit = (totFreeMemory * 60) / 100;
+      dbCacheLimit = (totFreeMemory * 75) / 100;
     }
     dbCacheSizeStr = Long.toString(dbCacheLimit);
     totalAvailBufferMemory = (totFreeMemory * 10) / 100;

--
Gitblit v1.10.0