Uh oh!
There was an error while loading. Please reload this page.
[SPARK-24107][CORE][followup] ChunkedByteBuffer.writeFully method has not reset the limit value - #21327
[SPARK-24107][CORE][followup] ChunkedByteBuffer.writeFully method has not reset the limit value#21327cloud-fan wants to merge 2 commits into
Conversation
cloud-fan
commented
May 15, 2018
SparkQA
commented
May 15, 2018
Test build #90622 has finished for PR 21327 at commit
|
cloud-fan
commented
May 15, 2018
retest this please |
SparkQA
commented
May 15, 2018
Test build #90628 has finished for PR 21327 at commit
|
| } finally { | ||
| bytes.limit(curChunkLimit) | ||
| } | ||
| // If `bytes` is an on-heap ByteBuffer, the JDK will copy it to a temporary direct |
There was a problem hiding this comment.
how about the JDK -> the JVM?
There was a problem hiding this comment.
the caching happens in the JDK code, not some magic inside JVM.
| bytes.limit(curChunkLimit) | ||
| } | ||
| // If `bytes` is an on-heap ByteBuffer, the JDK will copy it to a temporary direct | ||
| // ByteBuffer when writing it out. The JDK caches one temporary buffer per thread, and we |
There was a problem hiding this comment.
The JDK caches one temporary buffer per thread
I don't think this statement is correct. According to Util.java, the cached number of temporary direct buffer is up to IOUtil.IOV_MAX.
if the cached temp buffer gets created and freed frequently
The problem is that the varied-sized heap buffers could cause a new allocation of temporary direct buffer and free of old direct buffer if the buffer size is larger than before
SparkQA
commented
May 16, 2018
Test build #90686 has finished for PR 21327 at commit
|
SparkQA
commented
May 16, 2018
Test build #90689 has finished for PR 21327 at commit
|
JoshRosen
commented
May 16, 2018
LGTM. Thanks for these changes; they really help to clarify this tricky piece of code for readers. |
cloud-fan
commented
May 17, 2018
retest this please |
SparkQA
commented
May 17, 2018
Test build #90710 has finished for PR 21327 at commit
|
LGTM. It's good comment added. |
viirya
commented
May 17, 2018
retest this please. |
SparkQA
commented
May 17, 2018
Test build #90715 has finished for PR 21327 at commit
|
cloud-fan
commented
May 17, 2018
thanks, merging to master! |
What changes were proposed in this pull request?
According to the discussion in #21175 , this PR proposes 2 improvements:
limitto write outByteBufferwith slices.try ... finallyHow was this patch tested?
existing tests