users@glassfish.java.net

OutOfMemory due to SocketChannelOutputBuffer?!?!

From: <glassfish_at_javadesktop.org>
Date: Mon, 14 Jul 2008 11:54:51 PDT

We've recently deployed an application on SJSAS 9.0 Update 1 (Glassfish Derived) and are encountering a surprising issue. After the server is up for a while (between 30-60 minutes) we see a large jump in heap usage, for instance ~39M to ~220M. Analysis of a heap dump points to a single byte array inside of SocketChannelOutputBuffer (in this case ~167M):

&nbsp;&nbsp;Response response
&nbsp;&nbsp;&nbsp;&nbsp;SocketChannelOutputBuffer outputByteBuffer
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HeapByteBuffer outputByteBuffer
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;byte[] <-- 167MB

This does not seem to be in connection with any request output totalling anywhere near 167MB, and this large buffer seems to survive indefinitely after completion of the request.

Is this known behavior in Glassfish/SJSAS that is manageable with config changes or resolved/planned in a later updated? Does anyone have a suggestion of what to look for in our code that could be causing this situation?

Any help would be greatly appreciated!
Peter
[Message sent by forum member 'porterpe' (porterpe)]

http://forums.java.net/jive/thread.jspa?messageID=286527