Trustin, I think we need to another Allocater which just wraps around a given byte[] and does not do any pooling etc. This would be usefull in following situation: * High rate transaction ( > 100 transactions/sec) where one has to copy/creat small buffer * Avoidance of GC at that rate
mahadevan On 6/27/06, Trustin Lee <[EMAIL PROTECTED]> wrote:
On 6/27/06, G.S.S. Mahadevan <[EMAIL PROTECTED]> wrote: > > Trustin, > > Thanks for the fix. > > It seems that there is some problem is fix -- I tried in same way few > days ago and while I ran JUnit test case, it is failing. I had used > same lines( as in the fix submitted). I am using Sun JDK 1.5.0_06. > Here is my JUNit test case for this: > > Sorry for not intimating you earlier, as I was busy. I tried to debug > the issue, but could not get time, so I thought that I would fix it > later and submit to you later. It is because you're dealing with direct buffers, not heap buffers. MINA allocates direct buffers by default. You can change this behavior by creating your own ByteBufferAllocator based on org.apache.mina.common.SimpleByteBufferAllocator and calling ByteBuffer.setAllocator(). Perhaps we need two versions of ByteBufferAllocators? WDYT? Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP key fingerprints: * E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E * B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6
