directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny (JIRA)" <j...@apache.org>
Subject [jira] Closed: (DIRSERVER-1293) memory leak in BootstrapSchemaLoader (PATCH included)
Date Sun, 15 Feb 2009 19:49:02 GMT

     [ https://issues.apache.org/jira/browse/DIRSERVER-1293?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Emmanuel Lecharny closed DIRSERVER-1293.
----------------------------------------


closed

> 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