4 Replies Latest reply on Oct 24, 2009 8:22 AM by Vicky Kak

    Threads Number Increase - WorkManager

    Roded Hess Newbie

      I'm running JBoss 5.
      I see that memory keep increasing as time pass.
      The number of active threads are increasing. The following stacktrace is taken from an active thread which is one of many threads with the same name (WorkManager(n))(These are the threads that are being added as time pass).
      What can i learn from the stacktrace? How can I go deeper and have clearer view of what is going on?

      Name: WorkManager(2)-92
      State: WAITING on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@4e2e52
      Total blocked: 1 Total waited: 1

      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:1925)
      java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358)
      java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
      java.lang.Thread.run(Thread.java:619)

      Thanks,
      Rod

        • 1. Re: Threads Number Increase - WorkManager
          Peter Johnson Master

          What do you mean by "memory keep increasing"? What data are you looking at to determine this?

          The following stacktrace is taken from an active thread

          Actually, this thread is not active - it is waiting for work to do. It was active earlier but finished its work and is now in the thread pool awaiting another request.

          I think that the WorkManager threads handle remote service calls (such as remote EJB and messaging). The threads beginning with "htttp" and the IP address or hostname handle web app and web services requests.

          Each thread is allocated a given amount of memory for the trhead stack. You can adjust the size of the thread stack by using the -Xrs or -XX:ThreadStackSize options. I'd tell you the default but it depends on the OS and CPU architecture (usually it is either 512K or 1MB).

          • 2. Re: Threads Number Increase - WorkManager
            Roded Hess Newbie

            Hi Peter,
            Thanks for the quick reply.
            If I understand correctly, If the Thread is in wait state - this mean it waits for a "task". I assumes the number of threads of this type (WorkManger) are limited by thread pool size configuration right?

            Regarding memory I look in the memory tab or in JOPR:
            JVM Free Memory 383.3MB
            JVM Max Memory 1.3GB
            JVM Total Memory 1.3GB


            Rod

            • 3. Re: Threads Number Increase - WorkManager
              Peter Johnson Master

              The "memory tab" of what?

              The data reported by JOPR comes from the Runtime class and covers only the Java heap. The memory used for the thread stacks is not in the heap.

              It is expected that the memory in use in the heap will grow (that is, avail heap memory will decrease) until the JVM determines that the tenured generation of the heap is too full, at which time it will run a major garbage collection and free up heap space.

              • 4. Re: Threads Number Increase - WorkManager
                Vicky Kak Master

                 

                "rodedh" wrote:
                I assumes the number of threads of this type (WorkManger) are limited by thread pool size configuration right?

                Yes they should be, the WorkManager threads should come from the JCA part and they are configured in $JBOSS_HOME/server/default/deploy/jca-jboss-beans.xml.
                Ideally you should investigate the threaddump from the server and figure out what is going on.