directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Seelmann <>
Subject Memory leak in integration tests + need to improve DefaultDirectoryService.shutdown()
Date Wed, 24 Nov 2010 10:29:46 GMT
Hi guys,

there is/was a memory leak when running integration tests. I analyzed
a heap dump and saw that when running core-integ there were 350000
instances of SchemaObjectWrapper which hold lot of String objects.

The problem is the following:
The FrameworkSuite (or better its super class Suite) holds a list of
all Runners (FrameworkRunner in our case).
The FrameworkRunner holds a reference to a DirectoryService.
The DefaultDirectoryService holds many references, especially to the
schema manager.

Even when FrameworkRunner calls DirectoryService.shutdown() when the
test is finished, the directory service still holds references to
schema manager. As a consequence all schema objects created in each
test survive till the the test suite is finished.

I committed a quick workaround in [1], see the difference in heap
usage in [2] and [3].

Still I want to ask if it won't be better to clean and nullout all
instance variables of DefaultDirectoryService when its shutdown()
method is called? But I'm not sure if it works because we also have
tests that shutdown and startup the directory service. Thoughts?

Kind Regards,


View raw message