[rules-dev] Fix threadpool size for ExecutorProvider

boukadam index at live.fr
Fri Jun 20 11:40:29 EDT 2014


Hi all,

I'm using drools (version 5.5.0) for heavy processes and after many
executions I noticed an important number of Thread instanciated inside the
JVM. After debugging, these threads are created by
org.drools.concurrent.ExecutorProviderImpl. This class provides an executor
service without limitation of pool size :

private static final java.util.concurrent.ExecutorService executor =
Executors.newCachedThreadPool(new ThreadFactory() {
        public Thread newThread(Runnable r) {
            Thread t = new Thread(r);
            t.setDaemon(true);
            return t;
        }
    });;

This implementation is registered for the service in
org.drools.util.ServiceRegistryImpl: 

private void init() {
  ...
  addDefault(  ExecutorProvider.class,
                     "org.drools.concurrent.ExecutorProviderImpl");
  ...
}

Is there a reason to unlimit pool size? This service could be disabled or
overload by another implementation to avoid hundreds of threads inside the
JVM?

Thanks in advance.

Mohammed BOUKADA



--
View this message in context: http://drools.46999.n3.nabble.com/Fix-threadpool-size-for-ExecutorProvider-tp4030123.html
Sent from the Drools: Developer (committer) mailing list mailing list archive at Nabble.com.


More information about the rules-dev mailing list