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

Address Service: Resolve memory issues with large queries #372

Closed
braydonf opened this issue Dec 10, 2015 · 2 comments
Closed

Address Service: Resolve memory issues with large queries #372

braydonf opened this issue Dec 10, 2015 · 2 comments

Comments

@braydonf
Copy link
Contributor

A few ideas for optimization of memory usage for large queries:

  • getAddressSummary: Create an iterator to sum the balances as we're handling the inputs and outputs, instead of needing to keep the entire inputs and outputs in memory. These results could optionally be cached by block height, to optimize future queries.
  • getAddressHistory: When retrieving the address history, instead of getting all inputs and outputs and then combining them by transaction all at once. We could do that process based on chunks through a range of block heights, and stream the response, keeping the memory usage lower. This could be a new method createAddressHistoryStream. Related: combineTransactionInfo memory usage #354
@braydonf
Copy link
Contributor Author

Using stream transforms has helped with memory issues in combination with lowering the maxOpenFiles of leveldb. Here is some test code: https://gist.github.com/braydonf/c88bbc76a8e925357d55

@braydonf
Copy link
Contributor Author

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

No branches or pull requests

1 participant