commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <>
Subject [jira] [Resolved] (CONFIGURATION-687) Memory leak and related issues with CombinedConfigurationBuilder
Date Thu, 10 May 2018 17:30:00 GMT


Oliver Heger resolved CONFIGURATION-687.
       Resolution: Fixed
    Fix Version/s: 2.3

This was indeed a major problem. Many thanks for spotting it.

A fix was committed in SVN revision 1831360. The builders for child configurations are now
created only once. The trouble with unnecessary reloading operations should be solved by this
fix as well.

Could you please double-check?

> Memory leak and related issues with CombinedConfigurationBuilder
> ----------------------------------------------------------------
>                 Key: CONFIGURATION-687
>                 URL:
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: File reloading
>    Affects Versions: 2.2
>            Reporter: Luke Hamaty
>            Priority: Major
>             Fix For: 2.3
>         Attachments:
> 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
> 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