colinmjj commented on code in PR #74:
URL: https://github.com/apache/incubator-uniffle/pull/74#discussion_r930578314


##########
client-spark/common/src/main/java/org/apache/spark/shuffle/reader/RssShuffleDataIterator.java:
##########
@@ -106,8 +108,11 @@ public boolean hasNext() {
       shuffleReadMetrics.incFetchWaitTime(fetchDuration);
       if (compressedData != null) {
         shuffleReadMetrics.incRemoteBytesRead(compressedData.limit() - 
compressedData.position());
+        if (uncompressedData != null && uncompressedData.isDirect()) {
+          ((DirectBuffer)uncompressedData).cleaner().clean();

Review Comment:
   @xianjingfeng Good catch for these possible resource leak, but there should 
be different methods to do the clean staff according to JDK's version. Here is 
how spark deal with it, 
https://github.com/apache/spark/blob/master/common/unsafe/src/main/java/org/apache/spark/unsafe/Platform.java#L63



-- 
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]

Reply via email to