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 memory leak and reduce overall memory usage #365

Merged
merged 45 commits into from
Jan 11, 2018
Merged

Conversation

pm47
Copy link
Member

@pm47 pm47 commented Jan 8, 2018

This PR adds better management of resources, mainly:

  • define a proper supervisor strategy in the authenticator
  • sql PreparedStatement are now explicitely closed
  • the origins map (which allows to not ping-pong announcements to the same peer) has been removed, instead the stash/rebroadcast/awaiting collections all maintain a reference to the origin peer

When a channel enters the CLOSING state:

  • we remember which transactions have already reached min_depth, and don't republish/watch them on restart
  • we don't watch the funding tx as soon as we know that it has been spent by a tx which has reached min_depth

Also, the zmq watcher doesn't trigger a TickNewBlock on new WatchConfirmed anymore, this was causing a massive herd effect on startup.

Note that this PR implies a non-backward-compatible change in DATA_CLOSING.

Fixes #357.

pm47 and others added 30 commits January 6, 2018 14:50
otherwise, this would frequently cause 2 successful parallel connections
@pm47 pm47 requested a review from sstone January 10, 2018 15:53
@pm47 pm47 changed the title [WIP] Fix memory leak and reduce overall memory usage Fix memory leak and reduce overall memory usage Jan 10, 2018
@pm47 pm47 merged commit a00fd96 into master Jan 11, 2018
@pm47 pm47 deleted the fix-memory-leak branch January 11, 2018 12:09
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.

Possible Memory Leak
2 participants