Skip to content
New issue

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

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

Already on GitHub? # to your account

Use composite cumulator for message decoding #530

Merged
merged 1 commit into from
Sep 21, 2018

Conversation

lutovich
Copy link
Contributor

MessageDecoder is responsible for assembling full Bolt messages. It accumulates bytes until an empty chunk is received. Empty chunk signals a message boundary. It used to copy all received chunks into a larger buffer every time. This resulted in an increased memory usage when receiving large results.

This PR makes MessageDecoder store all received chunks in a composite buffer. No buffer copying is done. It is achieved by using a different non-default byte buffer cumulator. System property "messageDecoderCumulator" can be used to make decoder use the default copying/merging cumulator "-DmessageDecoderCumulator=merge".

`MessageDecoder` is responsible for assembling full Bolt messages. It
accumulates bytes until an empty chunk is received. Empty chunk signals
a message boundary. It used to copy all received chunks into a larger
buffer every time. This resulted in an increased memory usage when
receiving large results.

This commit makes `MessageDecoder` store all received chunks in a
composite buffer. No buffer copying is done. It is achieved by
using a different non-default byte buffer cumulator. System property
"messageDecoderCumulator" can be used to make decoder use the default
copying/merging cumulator "-DmessageDecoderCumulator=merge".
@ali-ince ali-ince merged commit 6bbb344 into neo4j:1.7 Sep 21, 2018
@lutovich lutovich deleted the 1.7-composite_cumulator branch September 21, 2018 09:59
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants