ARTEMIS-1808 LargeServerMessageImpl leaks direct ByteBuffer

largeMessagesFactory::newBuffer could create a pooled direct ByteBuffer
that will not be released into the factory pool: using a heap ByteBuffer
will perform more internal copies, but will make it simpler to be garbage
collected.
This commit is contained in:
Francesco Nigro 2018-04-15 17:31:05 +02:00 committed by Clebert Suconic
parent 90b9a9809a
commit e310bb68b1
1 changed files with 1 additions and 1 deletions

View File

@ -210,7 +210,7 @@ public final class LargeServerMessageImpl extends CoreMessage implements LargeSe
validateFile();
file.open();
int fileSize = (int) file.size();
ByteBuffer buffer = this.storageManager.largeMessagesFactory.newBuffer(fileSize);
ByteBuffer buffer = ByteBuffer.allocate(fileSize);
file.read(buffer);
return new ChannelBufferWrapper(Unpooled.wrappedBuffer(buffer));
} catch (Exception e) {