Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-26674][CORE] Consolidate CompositeByteBuf when reading large f…
…rame ## What changes were proposed in this pull request? Currently, TransportFrameDecoder will not consolidate the buffers read from network which may cause memory waste. Actually, bytebuf's writtenIndex is far less than it's capacity in most cases, so we can optimize it by doing consolidation. This PR will do this optimization. Related codes: https://github.com/apache/spark/blob/9a30e23211e165a44acc0dbe19693950f7a7cc73/common/network-common/src/main/java/org/apache/spark/network/util/TransportFrameDecoder.java#L143 ## How was this patch tested? UT Please review http://spark.apache.org/contributing.html before opening a pull request. Closes #23602 from liupc/Reduce-memory-consumption-in-TransportFrameDecoder. Lead-authored-by: liupengcheng <liupengcheng@xiaomi.com> Co-authored-by: Liupengcheng <liupengcheng@xiaomi.com> Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>
- Loading branch information
liupengcheng
authored and
Marcelo Vanzin
committed
Feb 26, 2019
1 parent
4baa2d4
commit 52a180f
Showing
2 changed files
with
127 additions
and
17 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
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