szetszwo commented on pull request #325:
URL: https://github.com/apache/incubator-ratis/pull/325#issuecomment-739486881
The problem may be because it keeps calling ByteBuffer.allocateDirect(..),
which is slow and has memory leak. We need a buffer pool.
```
ByteBuffer byteBuffer = ByteBuffer.allocateDirect(bytesToRead);
long offset = 0L;
while (fileChannel.read(byteBuffer) > 0) {
...
if (bytesToRead > 0) {
byteBuffer = ByteBuffer.allocateDirect(bytesToRead);
}
}
```
Could you post some benchmark results on RATIS-1176?
----------------------------------------------------------------
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]