You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Arnoud Glimmerveen (Jira)" <ji...@apache.org> on 2025/05/26 20:27:00 UTC

[jira] [Created] (FELIX-6784) Reduce number of thread (re)creations of the Configurator Worker Thread

Arnoud Glimmerveen created FELIX-6784:
-----------------------------------------

             Summary: Reduce number of thread (re)creations of the Configurator Worker Thread
                 Key: FELIX-6784
                 URL: https://issues.apache.org/jira/browse/FELIX-6784
             Project: Felix
          Issue Type: Improvement
          Components: Configurator
            Reporter: Arnoud Glimmerveen


When looking into Thread creation, I noticed that the Apache Configurator Worker Thread can be (re)created quite a number of times. I traced this to the WorkerQueue implementation, which lets the underlying Thread terminate if it has no tasks to execute anymore. 

As tasks scheduling is a bit spread out/task execution is relatively short, the WorkerQueue in  most cases after completing a task, determines there are no pending tasks, and lets the underlying thread terminate. 
In my case during startup this happens about 140 times (in an application with around 90 bundles). As the configurator's tasks are mostly related to responding to bundle events, in an application consisting of more bundles I expect this figure of Thread creations to be bigger as well.

Though I haven't observed issues following the observed behaviour, I do think the configurator implementation can benefit from a slightly alternate approach to dealing with platform resources, like introducing a grace-period before freeing up resources.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)