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] Resolved: (DIRSERVER-1293) memory leak in BootstrapSchemaLoader (PATCH included)
Date Tue, 02 Dec 2008 21:40:45 GMT

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

Emmanuel Lecharny resolved DIRSERVER-1293.
------------------------------------------

    Resolution: Fixed

Applied in ads-mina2.0 branch (will be merged in trunk in a few days).

Thanks for the patch !

PS: when submitting a patch, try to attach it instead of copy/past it, and also create it
from the root of Apache Directory, instead of from the src directory : it's a bit more easier
to apply :)

Fixed in :
http://svn.apache.org/viewvc?rev=722620&view=rev

> 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