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:
parent
90b9a9809a
commit
e310bb68b1
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue