From 73dd9bc58413442f19cdff6a450b1a1ae167c270 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Tue, 28 Aug 2007 21:43:46 +0000
Subject: [PATCH] Update the TestCaseUtils.clearJEBackend() method to use a different approach. Instead of closing the environment, deleting the files, and re-opening the environment, we are keeping the environment open and just truncating the databases.  This dramatically reduces the amount of memory required to run the unit tests, apparently as a result of a memory leak in the Berkeley DB JE when the environment is repeatedly opened and closed.

---
 opends/src/server/org/opends/server/backends/jeb/RootContainer.java |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/backends/jeb/RootContainer.java b/opends/src/server/org/opends/server/backends/jeb/RootContainer.java
index 4091b40..efb5181 100644
--- a/opends/src/server/org/opends/server/backends/jeb/RootContainer.java
+++ b/opends/src/server/org/opends/server/backends/jeb/RootContainer.java
@@ -670,6 +670,15 @@
     return (nextid.get() - 1);
   }
 
+  /**
+   * Resets the next entry ID counter to zero.  This should only be used after
+   * clearing all databases.
+   */
+  public void resetNextEntryID()
+  {
+    nextid.set(1);
+  }
+
 
 
   /**

--
Gitblit v1.10.0