directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Toby Stevens (JIRA)" <j...@apache.org>
Subject [jira] Created: (DIRSERVER-1293) memory leak in BootstrapSchemaLoader (PATCH included)
Date Tue, 02 Dec 2008 20:00:47 GMT
memory leak in BootstrapSchemaLoader (PATCH included)
-----------------------------------------------------

                 Key: DIRSERVER-1293
                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1293
             Project: Directory ApacheDS
          Issue Type: Bug
         Environment: 3rd party test harness
            Reporter: Toby Stevens


BootstrapSchemaLoader uses thread local variables, which will never fall out of scope.

This problem effects test suites that use an embedded server.

Below is a proposed solution:


Index: src/main/java/org/apache/directory/server/schema/bootstrap/BootstrapSchemaLoader.java
===================================================================
--- src/main/java/org/apache/directory/server/schema/bootstrap/BootstrapSchemaLoader.java
(revision 722529)
+++ src/main/java/org/apache/directory/server/schema/bootstrap/BootstrapSchemaLoader.java
(working copy)
@@ -185,10 +185,18 @@
        this.registries.set( registries );
        this.schemas.set( ( BootstrapSchema ) schema );

-        for ( ProducerTypeEnum producerType:ProducerTypeEnum.getList() )
+        try
        {
-            BootstrapProducer producer = getProducer( ( BootstrapSchema ) schema, producerType.getName()
);
-            producer.produce( registries, cb );
+	        for ( ProducerTypeEnum producerType:ProducerTypeEnum.getList() )
+	        {
+	            BootstrapProducer producer = getProducer( ( BootstrapSchema ) schema, producerType.getName()
);
+	            producer.produce( registries, cb );
+	        }
+        }
+        finally
+        {
+            this.registries.set( null );
+            this.schemas.set( null );
        }

        notifyListenerOrRegistries( schema, registries );

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message