Are you running both the client and server in the same VM? If you are, please try to run them in separate VM:s and see if both still run out of memory. I suspect that some buffer isn't released properly but it seems unlikely that both ends fail at the same time unless they are in the same VM.

The maximum heap size is at 64 MB, right?

Would it possible for you to post your code (the relevant parts) to the list?

/Niklas

Johannes Zillmann wrote:
Hello folks,

i'm sending a 83 MB file over net with help of mina.
The receiving hanlder is a StreamIoHandler, a own
thread reads from IoSessionInputStream and write the
bytes to file. After writing 65MB successfully to disk i've got
following exceptions:
on SocketChannelImpl.read:

java.lang.OutOfMemoryError
        at java.nio.Bits.reserveMemory(Bits.java:618)
        at
java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:95)
        at
java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:285)
        at
sun.nio.ch.Util.getTemporaryDirectBuffer(Util.java:54)
        at sun.nio.ch.IOUtil.read(IOUtil.java:205)
        at
sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:207)
        at
org.apache.mina.transport.socket.nio.support.SocketIoProcessor.read(SocketIoProcessor.java:291)
        at
org.apache.mina.transport.socket.nio.support.SocketIoProcessor.process(SocketIoProcessor.java:265)
        at
org.apache.mina.transport.socket.nio.support.SocketIoProcessor.access$4(SocketIoProcessor.java:254)
        at
org.apache.mina.transport.socket.nio.support.SocketIoProcessor$Worker.run(SocketIoProcessor.java:625)

and on SocketChannelImpl.write:
WARN
org.apache.mina.common.support.DefaultExceptionMonitor
- Unexpected exception.
java.lang.OutOfMemoryError
        at java.nio.Bits.reserveMemory(Bits.java:618)
        at
java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:95)
        at
java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:285)
        at
sun.nio.ch.Util.getTemporaryDirectBuffer(Util.java:54)
        at sun.nio.ch.IOUtil.write(IOUtil.java:69)
        at
sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:300)
        at
org.apache.mina.transport.socket.nio.support.SocketIoProcessor.doFlush(SocketIoProcessor.java:500)
        at
org.apache.mina.transport.socket.nio.support.SocketIoProcessor.doFlush(SocketIoProcessor.java:434)
        at
org.apache.mina.transport.socket.nio.support.SocketIoProcessor.access$5(SocketIoProcessor.java:395)
        at
org.apache.mina.transport.socket.nio.support.SocketIoProcessor$Worker.run(SocketIoProcessor.java:628)

Have sombody a hint for me ?
I'm using the latest 0.9 head.

cheers Johannes


        

        
                
___________________________________________________________ Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

Reply via email to