commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luke Hamaty (JIRA)" <>
Subject [jira] [Created] (CONFIGURATION-687) Memory leak and related issues with CombinedConfigurationBuilder
Date Thu, 08 Mar 2018 19:55:00 GMT
Luke Hamaty created CONFIGURATION-687:

             Summary: Memory leak and related issues with CombinedConfigurationBuilder
                 Key: CONFIGURATION-687
             Project: Commons Configuration
          Issue Type: Bug
          Components: File reloading
    Affects Versions: 2.2
            Reporter: Luke Hamaty

In CombinedConfigurationBuilder, each call to resetResult() adds new builders to the list
of child builders. Likewise, and likely for the same reason, for ReloadingCombinedConfigurationBuilder,
the resetResult() call adds to the list of subcontrollers.

When resetResult() is called because of an reload update, the next _n_ calls to getReloadingController().checkForReloading()
will also initiate reloading,  causing a reset and increasing the number of subcontrollers.
So the first change causes 1 reload, the second change causes 2 reloads, and it doubles each
time, so the 7th touch leads to 128 reloads!

Functionally, there are no apparent symptoms until memory exhaustion and/or thrashing occur.

This seems to be happen because CombinedConfigurationBuilder.initResultInstance rebuilds from
the parameters without clearing all of the existing state, particularly _sourceData_, so SourceData
ends up adding the reconstructed builders on top of the existing ones. Correcting this could
be as simple as cleaning up and clearing sourceData to force creation of new SourceData.

Code in attached zip (maven project) demonstrates the issue.


This message was sent by Atlassian JIRA

View raw message