mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Bauroth <michael.baur...@falcom.de>
Subject Memory leak?
Date Tue, 04 Jul 2006 09:59:14 GMT

I've attached a method from a simple TCP client, which only writes 
continously data to a server. Unfortunately over the time the memory 
consumption increases continously too. I will check the whole thing with 
JProbe now, but maybe someone has an idea before?!

public void writeProtocol( IoSession pSession, int pCounter )  {
     ByteBuffer tWriteBuffer = ByteBuffer.wrap(("aaa\r\n" +
	"aaa\r\n" +
	"aaa\r\n" +
	"aaa\r\n" + pCounter + ">\r\n").getBytes());
     pSession.write( tWriteBuffer );

When I use ByteBuffer.setUseDirectBuffers( true ), the memory leak 
occurs, if I use ByteBuffer.setUseDirectBuffers( false ) instead, the 
app works without memory leak. On the server side (same computer) I use 
direct buffers all the time!


View raw message