Skip to content

Significantly Lower Monitoring HttpExport Memory Footprint (#48854)#48966

Merged
original-brownbear merged 1 commit intoelastic:7.xfrom
original-brownbear:48854-7.x
Nov 12, 2019
Merged

Significantly Lower Monitoring HttpExport Memory Footprint (#48854)#48966
original-brownbear merged 1 commit intoelastic:7.xfrom
original-brownbear:48854-7.x

Conversation

@original-brownbear
Copy link
Copy Markdown
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

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
Copy Markdown
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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants