You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Luis Neves <lu...@co.sapo.pt> on 2006/07/24 16:13:45 UTC

Help with OutOfMemoryError

Hi all,

I could use some help with trying to diagnose and prevent the OutOfMemory
errors.
I'm developing a "proxy" to allow non Java clients to interface with our
internal messaging servers.

The protocol is as simple as could be:

------------
| Length   | -> integer in network order
------------
| Payload  | -> Xml Soap Message
------------

My decoder extends "CumulativeProtocolDecoder" and goes something like this:

protected boolean doDecode(IoSession session, ByteBuffer in, ProtocolDecoderOutput out) throws Exception
{
	if (in.remaining() < 4)
	{
		return false;
	}
	
	(...)
	//read the length of the xml message
	// read bytes until length
	// deserialize the xml
	// write the the deserialized object to the ProtocolDecoderOutput
}


The problem is that I keep getting OO errors under load, I tried to use the
recent "ReadThrottleFilterBuilder", custom ByteBufferAllocators, fiddle
with the "ReceiveBufferSize", and some combinations of the above, but to no avail.

I have the full source code for this here:
<http://websites.labs.sapo.pt/mina/OoeTestCase.zip>

To use it just execute "pt.com.bus.Start" and then "pt.com.bus.Producer" with
the "Producer" running in the same machine as the server it shouldn't take long
to get the OO error.

Does anyone have any clue to what am I doing wrong?

Thanks!

--
Luis Neves


Re: Help with OutOfMemoryError

Posted by peter royal <pr...@apache.org>.
On Jul 24, 2006, at 10:13 AM, Luis Neves wrote:
> I have the full source code for this here:
> <http://websites.labs.sapo.pt/mina/OoeTestCase.zip>
>
> To use it just execute "pt.com.bus.Start" and then  
> "pt.com.bus.Producer" with
> the "Producer" running in the same machine as the server it  
> shouldn't take long
> to get the OO error.
>
> Does anyone have any clue to what am I doing wrong?

Luis, I'll try and take a peek at this soon.. Just very busy in other  
areas of life atm :)

-pete


-- 
proyal@apache.org - http://fotap.org/~osi