activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [2/2] activemq-artemis git commit: ARTEMIS-1808 LargeServerMessageImpl leaks direct ByteBuffer
Date Tue, 17 Apr 2018 15:00:51 GMT
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.


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/e310bb68
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/e310bb68
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/e310bb68

Branch: refs/heads/master
Commit: e310bb68b10546df8fe88500581d4761a4e14dae
Parents: 90b9a98
Author: Francesco Nigro <nigro.fra@gmail.com>
Authored: Sun Apr 15 17:31:05 2018 +0200
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Tue Apr 17 11:00:45 2018 -0400

----------------------------------------------------------------------
 .../core/persistence/impl/journal/LargeServerMessageImpl.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e310bb68/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageImpl.java
index 940f8b0..d940946 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageImpl.java
@@ -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) {


Mime
View raw message