On May 11, 2006, at 6:13 AM, Paul Mallach wrote:
My problem is memory that seems to be allocated outside of the normal java memory space. Normally my program uses about 400MB of heap memory, 30MB of other memory and the java process (sun jre 1.5.0) uses 1.1GB of memory. But after a few hours the process starts to grow rapidly until it dies, while heap and other memory usage (as reported inside the jvm and in my profiler)stays about the some.I suspect the memory leak to be related to either MySQL (as an externallibrary) or ByteBuffers.I double-checked that at every occurence of SQL statements all ResultSets and Statements are always properly closed. So unless I'm hitting a bug in thedriver I think that everything should be fine here.The other possibility is that I'm leaving some ByteBuffers hanging around.I'm still using MINA 0.8.2, so all my ByteBuffers will probably be directbuffers. Are they included in the number returned byRuntime.getRuntime().totalMemory() (this number doesn't grow at all)? Would the size of the allocated ByteBuffers be reflected in the heap size or in thenumber of object on the heap?
Direct ByteBuffer's won't show up in the heap. Try the latest release of MINA, you'll have to upgrade your app with the API changes, but the ByteBuffer pool now expires unused buffers, preventing memory growths like that.
-pete -- [EMAIL PROTECTED] - http://fotap.org/~osi
smime.p7s
Description: S/MIME cryptographic signature
