This week's book giveaway is in the Testing forum. We're giving away four copies of The Way of the Web Tester: A Beginner's Guide to Automating Tests and have Jonathan Rasmusson on-line! See this thread for details.
JVM LDAP connection pool size fluctuates unexpectedly
posted 10 years ago
I'm trying to test out the Java virtual machine connection pool mechanism and seem to be getting some weird results. I'm creating 10000 threads and then bombarding an LDAP server with searches using these threads. We're trying to test out using connection pooling to see if it provides better performance than without connection pooling.
From what I understand, the way connection pooling is supposed to work is that the Java Virtual machine will create a pool of connections which, for the most part should stay consistent and process connection requests as they come in. We are running the connection pool with an initial size of 100, a preferred size of 100, and a maximum size of 100, yet the virtual machine will initially create the pool, but will close some of the connections and then create new connections for the pool on the fly. We don't understand why its doing this. We're catch all exceptions and nothing is being caught. Since the initial size, the max size, and the preferred size are the same, we should always maintain 100 connections within the pool.
The command that we are using to run the application is:
If anyone could provide some insight into why this might be happening, it would be extremely helpful. We are using the jrockit-R26.3.0-jdk1.5.0_06 JVM, but this behavior has also been observed when we run our code against the standard SUN Java 1.5 JVM.