Skip to content
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

[fix][server]fix memory leak when operating ledger metadata #3662

Merged
merged 4 commits into from
Nov 27, 2022

Conversation

HQebupt
Copy link
Contributor

@HQebupt HQebupt commented Nov 22, 2022

Motivation

There is a memory leak point in Bookkeeper client, see the following heap report:
image

It happens when opening a non-existent or expired ledger data. The following screen shot is memeory leak point by Eclipse Memory Analyzer.
image

Changes

Handle exception and clean up when promise complete exceptionally.

Master Issue: #1

@HQebupt
Copy link
Contributor Author

HQebupt commented Nov 22, 2022

@StevenLuMT @hangc0276 @eolivelli PTAL

Copy link
Contributor

@hangc0276 hangc0276 left a comment

Choose a reason for hiding this comment

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

Nice catch!
Would you please add a test to protect this logic? thanks.

Copy link
Member

@StevenLuMT StevenLuMT left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@horizonzy horizonzy left a comment

Choose a reason for hiding this comment

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

LGTM.

@HQebupt
Copy link
Contributor Author

HQebupt commented Nov 27, 2022

Nice catch!
Would you please add a test to protect this logic? thanks.

added a unit test. PTAL @hangc0276

@StevenLuMT StevenLuMT merged commit 109688c into apache:master Nov 27, 2022
hangc0276 pushed a commit that referenced this pull request Dec 8, 2022
* [fix][server]fix memory leak when operating ledger metadata

(cherry picked from commit 109688c)
nicoloboschi pushed a commit to datastax/bookkeeper that referenced this pull request Jan 11, 2023
)

* [fix][server]fix memory leak when operating ledger metadata

(cherry picked from commit 109688c)
(cherry picked from commit 37cde4b)
yaalsn pushed a commit to yaalsn/bookkeeper that referenced this pull request Jan 30, 2023
)

* [fix][server]fix memory leak when operating ledger metadata
zymap pushed a commit that referenced this pull request Feb 16, 2023
* [fix][server]fix memory leak when operating ledger metadata

(cherry picked from commit 109688c)
gaozhangmin pushed a commit to gaozhangmin/bookkeeper that referenced this pull request Feb 23, 2023
Ghatage pushed a commit to sijie/bookkeeper that referenced this pull request Jul 12, 2024
)

* [fix][server]fix memory leak when operating ledger metadata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants