Skip to content

Conversation

@original-brownbear
Copy link
Contributor

The HttpExportBulk exporter is using a lot more memory than it needs to
by allocating buffers for serialization and IO:

  • Remove copying of all bytes when flushing, instead use the stream wrapper
  • Remove copying step turning the BAOS into a byte[]
    • This also avoids the allocation of a single huge byte[] and instead makes use of the internal paging logic of the BytesStreamOutput
  • Don't allocate a new BAOS for every document, just keep appending to a single BAOS

backport of #48854

…8854)

The `HttpExportBulk` exporter is using a lot more memory than it needs to
by allocating buffers for serialization and IO:

* Remove copying of all bytes when flushing, instead use the stream wrapper
* Remove copying step turning the BAOS into a `byte[]`
  * This also avoids the allocation of a single huge `byte[]` and instead makes use of the internal paging logic of the `BytesStreamOutput`
* Don't allocate a new BAOS for every document, just keep appending to a single BAOS
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Monitoring)

@original-brownbear original-brownbear merged commit ea9f094 into elastic:7.x Nov 12, 2019
@original-brownbear original-brownbear deleted the 48854-7.x branch November 12, 2019 07:49
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.

2 participants