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

Tristan Tarrant tristan.tarrant at gmail.com
Fri Jun 10 06:43:49 EDT 2011


> Somewhere in this thread there was discussion of creating a buffer per thread (thread-local again) but was determined to be too much of a mem leak (and I agree with this).

We should avoid thread locals :)

> Maybe it makes sense to create a pool of buffers, to be shared?  It would certainly save on gc overhead.  But what about the cost of synchronizing access to this buffer pool?  Maybe allocating one large buffer and different threads making use of different ranges here?  Again, the sync could be pretty complex.  But concievably lots of benefits though.

I wouldn't complicate things overmuch. I believe a simple pool based
on  ConcurrentLinkedQueue (with its synchronization) would be a much
better alternative to the current situation of allocation,
reallocation (maybe) and GC.

Tristan



More information about the infinispan-dev mailing list