hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Asankha C. Perera" <asan...@apache.org>
Subject Memory leak with non-keepalive SSL connection load test
Date Sun, 13 Dec 2009 19:45:37 GMT
Hi All

I've encountered a strange problem from a Synapse user using RHEL 32 bit
system, where a load test of non-keepalive SSL connections causes the
process to leak memory and ultimately crash. This does not happen on
Ubuntu which I use by default, and I had to run a CentOS instance on EC2
to reproduce and see this problem happening. The JDK I used was the
latest 1.6.17 - but I came across the links [1] and [2] from the past
which seems to indicate the problem

The problem seems to be due to the four direct byte buffers allocated
per each SSL connection, and possibly because the JVM does not GC since
the byte buffers are allocated outside of it. The memory leak is visible
to vmstat by rapidly declining free memory on the system, but not
visible on the heap memory usage. The stack trace before the crash I got
was:

Exception in thread "https-Listener I/O dispatcher-2"
java.lang.OutOfMemoryError: Direct buffer memory
    at java.nio.Bits.reserveMemory(Bits.java:633)
    at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:95)
    at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
    at
org.apache.http.impl.nio.reactor.SSLIOSession.<init>(SSLIOSession.java:113)
    at
org.apache.http.impl.nio.SSLServerIOEventDispatch.connected(SSLServerIOEventDispatch.java:110)
    at
org.apache.http.impl.nio.reactor.BaseIOReactor.keyCreated(BaseIOReactor.java:182)
    at
org.apache.http.impl.nio.reactor.AbstractIOReactor.processNewChannels(AbstractIOReactor.java:246)
    at
org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:153)
    at
org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:70)
    at
org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:318)
    at java.lang.Thread.run(Thread.java:619)

Has anyone encountered this issue before? my immediate next step is to
try on a 64bit OS version .. but I am curious to know how we could avoid
this problem

cheers
asankha

[1] http://lists.apple.com/archives/Java-dev/2006/Feb/msg00059.html
[2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5092131

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message