You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2017/06/28 13:40:21 UTC
activemq-artemis git commit: ARTEMIS-1223 OutOfDirectMemoryError
raised from TimedBuffer
Repository: activemq-artemis
Updated Branches:
refs/heads/1.x 15990589a -> bc815004d
ARTEMIS-1223 OutOfDirectMemoryError raised from TimedBuffer
(cherry picked from commit 9f8a14440bd39d061da18495cbdac58a24aa9db3)
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/bc815004
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/bc815004
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/bc815004
Branch: refs/heads/1.x
Commit: bc815004d2c849688128d463665d9f7f66092eaa
Parents: 1599058
Author: Francesco Nigro <ni...@gmail.com>
Authored: Tue Jun 27 11:47:44 2017 +0200
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Jun 28 09:39:57 2017 -0400
----------------------------------------------------------------------
.../org/apache/activemq/artemis/core/io/buffer/TimedBuffer.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bc815004/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBuffer.java
----------------------------------------------------------------------
diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBuffer.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBuffer.java
index 32b15fe..7d5370b 100644
--- a/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBuffer.java
+++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/buffer/TimedBuffer.java
@@ -100,7 +100,9 @@ public final class TimedBuffer {
}
// Setting the interval for nano-sleeps
//prefer off heap buffer to allow further humongous allocations and reduce GC overhead
- buffer = new ChannelBufferWrapper(Unpooled.directBuffer(size, size));
+ //NOTE: it is used ByteBuffer::allocateDirect instead of Unpooled::directBuffer, because the latter could allocate
+ //direct ByteBuffers with no Cleaner!
+ buffer = new ChannelBufferWrapper(Unpooled.wrappedBuffer(ByteBuffer.allocateDirect(size)));
buffer.clear();