Hi,

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());
        
    tWriteBuffer.acquire();
    pSession.write( tWriteBuffer );
    tWriteBuffer.release();
}

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!

Regards
Michael


Reply via email to