Skip to content

Fix memory leak in MHistorConfig & MBeanExpHelper #2531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 27, 2018

Conversation

artembilan
Copy link
Member

The MessageHistoryConfigurer is a BeanPostProcessor which keeps a
store of the TrackableComponent.
Something similar we have with the MBeanExporterHelper and its local
stores populated by the postProcessBeforeInitialization()

  • Implement DestructionAwareBeanPostProcessor in the
    MessageHistoryConfigurer and MBeanExporterHelper to remove destroyed
    beans from their caches

Cherry-pick to 5.0.x

The `MessageHistoryConfigurer` is a `BeanPostProcessor` which keeps a
store of the `TrackableComponent`.
Something similar we have with the `MBeanExporterHelper` and its local
stores populated by the `postProcessBeforeInitialization()`

* Implement `DestructionAwareBeanPostProcessor` in the
`MessageHistoryConfigurer` and `MBeanExporterHelper` to remove destroyed
beans from their caches

**Cherry-pick to 5.0.x**
@artembilan artembilan requested a review from garyrussell July 27, 2018 19:11

private final Set<String> siBeanNames = new HashSet<String>();
private final Set<String> siBeanNames = new HashSet<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be made concurrent to handle dynamic add/remove. See MessageHistoryConfigurer.

* Apply Java 8 style for collections iterations
@garyrussell garyrussell merged commit 55a43d3 into spring-projects:master Jul 27, 2018
garyrussell pushed a commit that referenced this pull request Jul 27, 2018
* Fix memory leak in MHistorConfig & MBeanExpHelper

The `MessageHistoryConfigurer` is a `BeanPostProcessor` which keeps a
store of the `TrackableComponent`.
Something similar we have with the `MBeanExporterHelper` and its local
stores populated by the `postProcessBeforeInitialization()`

* Implement `DestructionAwareBeanPostProcessor` in the
`MessageHistoryConfigurer` and `MBeanExporterHelper` to remove destroyed
beans from their caches

**Cherry-pick to 5.0.x**

* * Fix concurrency and checkstyle
* Apply Java 8 style for collections iterations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants