You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by Ted Yu <yu...@gmail.com> on 2010/01/17 16:14:48 UTC

using direct buffers

Hi,
According to http://mina.apache.org/faq.html:
We recommend to switch the default buffer type to 'heap' by inserting the
following code before you start a server:

ByteBuffer.setUseDirectBuffers(false);

Should the above call should be inserted before calling
NioSocketAcceptor.bind() ?

If not, which call should I insert the above code before ?

Thanks

Re: using direct buffers

Posted by Ashish <pa...@gmail.com>.
> We use mina-core-2.0.0-RC1.jar
>
> Recently we incorporated mina-filter-compression-2.0.0-RC1.jar and I
> observed a strange problem which didn't exist without using compression
> filter.
>
> Our client can talk to server for several minutes after which client
> requests keep timeout. It seems server doesn't receive requests after some
> point.

There are two things that can help debug
1. Take a Thread dump, see what's going inside the System
2. Optionally, can use wireshark to monitor the network traffic

Point 1, shall lead to the next step of pin pointing and resolving the problem.

> If someone can share troubleshooting tips, especially w.r.t. compression
> filters, that would be great.
>

-- 
thanks
ashish

Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal

Re: using direct buffers

Posted by Ted Yu <yu...@gmail.com>.
We use mina-core-2.0.0-RC1.jar

Recently we incorporated mina-filter-compression-2.0.0-RC1.jar and I
observed a strange problem which didn't exist without using compression
filter.

Our client can talk to server for several minutes after which client
requests keep timeout. It seems server doesn't receive requests after some
point.

If someone can share troubleshooting tips, especially w.r.t. compression
filters, that would be great.

On Sun, Jan 17, 2010 at 7:41 AM, Emmanuel LŽcharny <el...@gmail.com>wrote:

> Ted Yu a écrit :
>
>> Hi,
>> According to http://mina.apache.org/faq.html:
>> We recommend to switch the default buffer type to 'heap' by inserting the
>> following code before you start a server:
>>
>> ByteBuffer.setUseDirectBuffers(false);
>>
>> Should the above call should be inserted before calling
>> NioSocketAcceptor.bind() ?
>>
>> If not, which call should I insert the above code before ?
>>
>>
> I suppose you are using MINA 1.x (please, *please*, PLEASE, _always_
> mention the vesion you are using when posting a question !!!)
>
> You can tell MINA to use heap buffers before doing anything, as it's a
> static flag. So do it in the very first line of your program.
>
> In MINA 2.0, there is no need to care about this : the ByteBuffer allocator
> uses Heap buffer as a default (MINA 1.x was totally wrong to use
> DirectBuffer by default) .
>
>
>

Re: using direct buffers

Posted by Emmanuel LŽcharny <el...@gmail.com>.
Ted Yu a écrit :
> Hi,
> According to http://mina.apache.org/faq.html:
> We recommend to switch the default buffer type to 'heap' by inserting the
> following code before you start a server:
>
> ByteBuffer.setUseDirectBuffers(false);
>
> Should the above call should be inserted before calling
> NioSocketAcceptor.bind() ?
>
> If not, which call should I insert the above code before ?
>   
I suppose you are using MINA 1.x (please, *please*, PLEASE, _always_ 
mention the vesion you are using when posting a question !!!)

You can tell MINA to use heap buffers before doing anything, as it's a 
static flag. So do it in the very first line of your program.

In MINA 2.0, there is no need to care about this : the ByteBuffer 
allocator uses Heap buffer as a default (MINA 1.x was totally wrong to 
use DirectBuffer by default) .