Skip to content

Commit 897f8b2

Browse files
committed
Use lock free cache in the byte buffer pool.
1 parent c00ceac commit 897f8b2

File tree

3 files changed

+270
-130
lines changed

3 files changed

+270
-130
lines changed

src/main/java/org/jsl/collider/ColliderImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ else if (sessionEmitter.useDirectBuffers == 0)
269269
final int joinPoolChunkSize = socketSendBufferSize * 2;
270270

271271
/* For the join pool byte order does not matter */
272-
m_joinPool = new RetainableByteBufferPool( joinPoolChunkSize, useDirectBuffers, ByteOrder.nativeOrder() );
272+
m_joinPool = new RetainableByteBufferPool(joinPoolChunkSize,
273+
useDirectBuffers, ByteOrder.nativeOrder(), 16, 2);
273274
}
274275
joinPool = m_joinPool;
275276
}
@@ -495,6 +496,9 @@ public void run()
495496
me.getValue().clear( s_logger );
496497
m_dataBlockCache.clear();
497498

499+
if (m_joinPool != null)
500+
m_joinPool.release( s_logger );
501+
498502
if (s_logger.isLoggable(Level.FINE))
499503
s_logger.fine( "finish (" + statLoopIt + ", " + statLoopReadersG0 + ")." );
500504
}

0 commit comments

Comments
 (0)