Jerry Cwiklik created UIMA-3263:
-----------------------------------

             Summary: Fix Ducc Agent thread leak
                 Key: UIMA-3263
                 URL: https://issues.apache.org/jira/browse/UIMA-3263
             Project: UIMA
          Issue Type: Bug
          Components: DUCC
            Reporter: Jerry Cwiklik
            Assignee: Jerry Cwiklik
             Fix For: 1.0-Ducc


For every process the Agent launches, it instantiates a Metric Collector object 
which gathers process metrics like CPU, swap, and many others. The metric 
collection is driven by a Camel route at regular intervals. Once the process 
stops (or dies) the route is shutdown.

Within Metric Collector object, each metric is collected in a separate thread 
managed by a thread pool. The main motivation is to collect metrics in parallel 
to improve performance. 

There are two separate problems in the current code:

1) The code uses a wrong type of thread pool, namely newFixedThreadPool. This 
pool has a fixed pool of threads which never expire even if idle. A better 
choice is the CachedThreadPool which creates threads on demand, reuses idle 
ones and kills those that are idle over 1 minute.

2) The thread pool is never shutdown when the process is shutdown. The code 
actually shuts down the Camel route which drives metric collection but its 
processor ( java object doing the metric collection) does not shutdown its 
thread pool causing the leak.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to