[infinispan-dev] Adaptive marshaller buffer sizes - ISPN-1102

Bela Ban bban at redhat.com
Mon May 23 16:55:52 EDT 2011



On 5/23/11 6:50 PM, Dan Berindei wrote:

>>   From my experience, reusing and syncing on a buffer will be slower than
>> making a simple arraycopy. I used to reuse buffers in JGroups, but got
>> better perf when I simply copied the buffer.
>
> We wouldn't need any synchronization if we reused one buffer per thread ;-)


Dangerous for 2 reasons. First a reused buffer can grow: for example if 
you send 2K messages all the time, then 1 5M message, then back to 2K, 
you might have a 5M sized buffer around, unless you do resizing every 
now and then. Second, you could end up with many threads, therefore many 
buffers, and this is unpredictable. As I mentioned in my previous email, 
the buffers we're talking about are on the receiver side, and if someone 
configures a large thread pool, you could end up with many buffers. 
Configuration of thread pools is outside of our control.

I suggest that - whatever you guys do - measure the impact on 
performance and memory usage. As I said before, my money's on simple 
copying... :-)



-- 
Bela Ban
Lead JGroups / Clustering Team
JBoss


More information about the infinispan-dev mailing list