You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Jerry Cwiklik (JIRA)" <de...@uima.apache.org> on 2013/09/13 15:36:52 UTC

[jira] [Closed] (UIMA-3263) Fix Ducc Agent thread leak

     [ https://issues.apache.org/jira/browse/UIMA-3263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jerry Cwiklik closed UIMA-3263.
-------------------------------

    Resolution: Fixed

Modified code to use CachedThreadPool and to shutdown the pool when an agent's child process terminates
                
> 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