forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Use more efficient buffering strategy for job input created by d…
…atafeeds (elastic#98915) Java's own `ByteArrayOutputStream` doubles the size of its buffer when it needs to grow. This can be inefficient and lead to risk of OOMs with small JVM heaps. For example, suppose we need to build `autodetect` input 16.1MB in size. When the input grows past 16MB the buffer size will increase to 32MB, with a temporary requirement for 48MB at the point where both buffers exist. This change switches to use Elasticsearch's `BytesStreamOutput` class, which manages memory more efficiently.
- Loading branch information
1 parent
88e2508
commit 34711e7
Showing
2 changed files
with
8 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pr: 98915 | ||
summary: Avoid risk of OOM in datafeeds when memory is constrained | ||
area: Machine Learning | ||
type: bug | ||
issues: [89769] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters