Hello,
I'm having some problems with memory allocation when handling large images (4m to 8m). Using jconsole, I see that the direct memory is increased, but it's never deallocated. Finally, the application throws a OutOfMemory exception and stops handling
further requests. The exception that is thrown is this:
INFO | jvm 1 | 2014/08/27 17:30:28 | Exception in thread "Dispatcher: Thread-17" java.lang.OutOfMemoryError: Direct buffer memory
INFO | jvm 1 | 2014/08/27 17:30:28 | at java.nio.Bits.reserveMemory(Unknown Source)
INFO | jvm 1 | 2014/08/27 17:30:28 | at java.nio.DirectByteBuffer.<init>(Unknown Source)
INFO | jvm 1 | 2014/08/27 17:30:28 | at java.nio.ByteBuffer.allocateDirect(Unknown Source)
INFO | jvm 1 | 2014/08/27 17:30:28 | at sun.nio.ch.Util.getTemporaryDirectBuffer(Unknown Source)
INFO | jvm 1 | 2014/08/27 17:30:28 | at sun.nio.ch.IOUtil.write(Unknown Source)
INFO | jvm 1 | 2014/08/27 17:30:28 | at sun.nio.ch.SocketChannelImpl.write(Unknown Source)
INFO | jvm 1 | 2014/08/27 17:30:28 | at org.simpleframework.transport.BufferWrapper.write(BufferWrapper.java:356)</init>
I tried to increase the direct memory size (-XX:MaxDirectMemorySize) to 800m, but it only delayed the OutOfMemory exception. Is there anything that can be done to deallocate this memory?
I'm using the latest version of simpleframework (5.1.6) on a Windows Server 2003 x64 box.
Best regards,
Telmo Simões