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

VolatileDB: fix memory leak #1379

Merged
merged 1 commit into from
Dec 27, 2019
Merged

VolatileDB: fix memory leak #1379

merged 1 commit into from
Dec 27, 2019

Conversation

mrBliss
Copy link
Contributor

@mrBliss mrBliss commented Dec 26, 2019

The VolatileDB maintains a number of in-memory indices among which:

type SuccessorsIndex blockId = Map (WithOrigin blockId) (Set blockId)

During garbage collection, this index was not being culled correctly: when the last blockId was removed from a Set, the empty Set was kept in the Map instead of removing the entry altogether.

The VolatileDB maintains a number of in-memory indices among which:

    type SuccessorsIndex blockId = Map (WithOrigin blockId) (Set blockId)

During garbage collection, this index was not being culled correctly: when the
last `blockId` was removed from a `Set`, the empty `Set` was kept in the `Map`
instead of removing the entry altogether.
@mrBliss mrBliss added consensus issues related to ouroboros-consensus volatile db labels Dec 26, 2019
@mrBliss mrBliss requested review from edsko and kderme December 26, 2019 15:29
Copy link
Contributor

@kderme kderme 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!

@mrBliss
Copy link
Contributor Author

mrBliss commented Dec 27, 2019

bors r+

iohk-bors bot added a commit that referenced this pull request Dec 27, 2019
1379: VolatileDB: fix memory leak r=mrBliss a=mrBliss

The VolatileDB maintains a number of in-memory indices among which:

    type SuccessorsIndex blockId = Map (WithOrigin blockId) (Set blockId)

During garbage collection, this index was not being culled correctly: when the last `blockId` was removed from a `Set`, the empty `Set` was kept in the `Map` instead of removing the entry altogether.

Co-authored-by: Thomas Winant <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Dec 27, 2019

Build failed

@mrBliss
Copy link
Contributor Author

mrBliss commented Dec 27, 2019

Uggh, bors fails because of some CI flakiness

@mrBliss
Copy link
Contributor Author

mrBliss commented Dec 27, 2019

bors r+

iohk-bors bot added a commit that referenced this pull request Dec 27, 2019
1379: VolatileDB: fix memory leak r=mrBliss a=mrBliss

The VolatileDB maintains a number of in-memory indices among which:

    type SuccessorsIndex blockId = Map (WithOrigin blockId) (Set blockId)

During garbage collection, this index was not being culled correctly: when the last `blockId` was removed from a `Set`, the empty `Set` was kept in the `Map` instead of removing the entry altogether.

Co-authored-by: Thomas Winant <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Dec 27, 2019

@iohk-bors iohk-bors bot merged commit ee06854 into master Dec 27, 2019
@iohk-bors iohk-bors bot deleted the mrBliss/fix-memory-leak branch December 27, 2019 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus issues related to ouroboros-consensus volatile db
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants