users@glassfish.java.net

Multiple SelectorThreads

From: <glassfish_at_javadesktop.org>
Date: Wed, 18 Jul 2007 12:38:45 PDT

Apologies if this is the wrong forum - which is extremely possible as I have absolutely no idea what's going on here! have a problem with an app (I'm not the author, but attempting to debug) which receives requests via IIOP. Platform is Sun Java App Server 8.1 (would need to demonstrate I can fix this to upgrade unfortunately) on Windows Server 2003 R2 with jdk 1.5.0_06. The app is dying over a period of time/usage with these:

java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start0(Native Method)
        at java.lang.Thread.start(Thread.java:574)

With a stack trace, I see hundreds of SelectorThreads, all in the following state. Thing is, all these threads look like they're just sitting there polling to me (?). 'netstat' also shows multiple connections on port 3360. I don't know why/what is spawning all these threads! They increase in count over time, and don't die. would really appreciate just a vague pointer of what this could be.

See loads of these in the stack trace - is it in a blocked state? -

"SelectorThread" daemon prio=6 tid=0x5312a298 nid=0x954 runnable [0x6042f000..0x
6042fb6c]
        at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
        at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(WindowsSelectorImpl.j
ava:275)
        at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(WindowsSelector
Impl.java:257)
        at sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:138)

        at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)
        - locked <0x1aefa8e8> (a sun.nio.ch.Util$1)
        - locked <0x1aefa8d8> (a java.util.Collections$UnmodifiableSet)
        - locked <0x1aefa860> (a sun.nio.ch.WindowsSelectorImpl)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
        at com.sun.corba.ee.impl.transport.SelectorImpl.run(SelectorImpl.java:24
2)
[Message sent by forum member 'ocoro02' (ocoro02)]

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