zuston commented on code in PR #254:
URL: https://github.com/apache/incubator-uniffle/pull/254#discussion_r990721194
##########
client-spark/common/src/main/java/org/apache/spark/shuffle/reader/RssShuffleDataIterator.java:
##########
@@ -109,24 +123,20 @@ public boolean hasNext() {
shuffleReadMetrics.incFetchWaitTime(fetchDuration);
if (compressedData != null) {
shuffleReadMetrics.incRemoteBytesRead(compressedData.limit() -
compressedData.position());
- // Directbytebuffers are not collected in time will cause executor
easy
- // be killed by cluster managers(such as YARN) for using too much
offheap memory
- if (uncompressedData != null && uncompressedData.isDirect()) {
- try {
- RssShuffleUtils.destroyDirectByteBuffer(uncompressedData);
- } catch (Exception e) {
- throw new RssException("Destroy DirectByteBuffer failed!", e);
- }
+
+ int uncompressedLen = compressedBlock.getUncompressLength();
+ if (uncompressedData == null || uncompressedData.capacity() <
uncompressedLen) {
+ uncompressedData = ByteBuffer.allocate(uncompressedLen);
Review Comment:
In original implementation, the bytebuffer will be destoryed and recreate.
So to avoid the frequent GC, it use the offheap-bytebuffer.
And in this PR, we will recycle the bytebuffer, so I think it's no need to
use the off-heap memory now. Maybe we should add the off-heap support in the
next PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]