Hello, I was monitoring a simple mina server using jconsole and I saw that after switching to heap buffers ( ByteBuffer.setUseDirectBuffers(false) ) the number of threads began to grow as more clients connected to the server.
With direct byte buffers the number of threads was constant no matter how many clients were connected ( 16 AnonymousIoService-x threads ). With heap byte buffers there appear to be a new thread for each new connected client. > Name: pool-31-thread-1 > State: WAITING on > [EMAIL PROTECTED] > Total blocked: 0 Total waited: 2 > > Stack trace: > sun.misc.Unsafe.park(Native Method) > java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) > java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1889) > java.util.concurrent.DelayQueue.take(DelayQueue.java:160) > java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:582) > java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:575) > java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:946) > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:906) > java.lang.Thread.run(Thread.java:619) > What is the reason to create a new thread for each client? Can this be tunned (limit the number of pool-x-thread-1 threads) ? Doesn't this prevent real scalability? Regards, Horia -- View this message in context: http://www.nabble.com/ByteBuffer.setUseDirectBuffers%28false%29-and-threads-tf3192238.html#a8862086 Sent from the mina dev mailing list archive at Nabble.com.
