[
https://jira.jboss.org/jira/browse/JBAS-6665?page=com.atlassian.jira.plug...
]
Ron Sigal commented on JBAS-6665:
---------------------------------
Hi Richard,
I'll explain a little bit about how the Remoting socket transport manages threads on
the server side. When a client connects to the ServerSocket maintained by Remoting, a
ServerThread (identified as a "WorkerThread" in the logs) is created to manage a
single Socket. The client maintains a pool of connections to these ServerThreads, and, as
long as the client is alive, it can use a pooled connection to transmit invocations to the
ServerThread. When the client disconnects, it closes its Socket, which results in the
server side Socket closing and the ServerThread returning to a thread pool, the size of
which is determined by the "maxPoolSize" parameter (default value 300). By
default, the ServerThread will stay alive as long as the associated Remoting Connector is
alive. There is an optional parameter, "idleTimeout", that, if set to a value N
greater than 0, will result in the creation of a TimerTask that runs every N seconds and
destroys any ServerThreads that haven't been used for the last N seconds. The default
behavior is to not run the TimerTask.
My understanding of the AS test suite is that an Application Server is started, then the
test suite runs, then the AS is shut down. If that's the case, then, yes, the number
of pooled ServerThreads could increase.
By the way, I note that the ServerThreads in memoryUsage.annotated.log are named
WorkerThread#2, ..., WorkerThread#37, which doesn't seem especially extraordinary.
If there's anything I'm missing, or anything I can clarify or fix, just let me
know.
-Ron
Server-side thread count steadily increases during AS testsuite runs
---------------------------------------------------------------------
Key: JBAS-6665
URL:
https://jira.jboss.org/jira/browse/JBAS-6665
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Test Suite
Affects Versions: JBossAS-5.0.1.GA
Environment: AS testsuite - not particular to any platform
Reporter: Richard Achmatowicz
Assignee: Richard Achmatowicz
Priority: Minor
Attachments: memoryUsage.annotated.log
(from an original email)
> Hi Rajesh
>
> Just wanted to let you know about something concerning the AS testsuite.
>
> I've been having real problems getting the AS 5.0.0 (and 5.0.1) testsuite to run
on HPUX without running out of native threads. It won't run to completion without
getting an "OutOfMemoryError: unable to create native thread" exception. So I
decided to try to find out how many threads are active in the JVM at any one time during a
testsuite run.
>
> I wrote a small modification to XMLJUnitMultipleResultFormatter which gets called
before and after every testsuite; it prints out the following statistics:
> <test name>: ThreadCounts(current threads, daemon threads,peak thread
count,total started), HeapSizes(init,used,committed,max)
>
> I'm seeing a strange creeping increase in the number of current threads active
in the JVM over the life of the 'all' server execution, which is where i'm
having the problem with native thread allocation. I would guess from this that some test
cases are not releasing threads when finished, although this is only a guess.
This is interesting. I would like to know if the HP UX maximum thread count is really low
or the AS doesn't release some threads on undeploying the tests.
Does a profiler show the list of all active threads when it runs out of active threads?
A comparison with a run on RHEL with these metrics enabled will also tell us if we have a
problem of threads being free'd on HPUX
Can you open a JBAS and assign it to yourself with the below details and the attached
log?
There should be some interesting comments on this from dev.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira