johnyangk commented on a change in pull request #223: [NEMO-388] Off-heap 
memory management (reuse ByteBuffer)
URL: https://github.com/apache/incubator-nemo/pull/223#discussion_r310457085
 
 

 ##########
 File path: 
runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/BlockManagerWorker.java
 ##########
 @@ -357,6 +358,12 @@ public void run() {
               for (final SerializedPartition partition : partitions) {
                 try (ByteOutputContext.ByteOutputStream os = 
outputContext.newOutputStream()) {
                   os.writeSerializedPartitionBuffer(partition);
 
 Review comment:
   Would it make sense to additionally pass a boolean here? releaseAfterDone? 
(There may be a better name)
   
   Then, in ByteOutputContext#writeSerializedPartitionBuffer, we can 
instantiate a ChannelFutureListener that releases the partition depending on 
the given boolean. We pass the listener down to writeByteBuf, writeBuffer, and 
writeDataFrame. 
   (Preferably, this listener does not check for `future#isXX()` and 
`partitionToRelease != null`)
   
   I think this lets us release the partition exactly when we want to. (i.e., 
always release when boolean=true, and the boolean is set **before** writing to 
the network).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to