sorry, that link should have been http://activemq.apache.org/maven/5.2.0/activemq-core/apidocs/src-html/org/apache/activemq/thread/TaskRunnerFactory.html
> -----Original Message----- > From: Millies, Sebastian [mailto:sebastian.mill...@softwareag.com] > Sent: Wednesday, October 05, 2011 11:31 PM > To: users@activemq.apache.org > Subject: RE: How to control thread creation in an embedded broker > > yes, the size of the thread pool is unbounded, if this is the > right source I'm looking at: > http://activemq.apache.org/maven/5.2.0/activemq- > core/apidocs/srchtml/org/apache/activemq/thread/TaskRunnerFactory.html > > In fact I was hoping to somehow replace that TaskRunnerFactory. > > I'll try to create a compact test case. May take me a few weeks > though... > > -- Sebastian > > -----Original Message----- > From: Torsten Mielke [mailto:tors...@fusesource.com] > Sent: Wednesday, October 05, 2011 3:41 PM > To: users@activemq.apache.org > Subject: Re: How to control thread creation in an embedded broker > > What's the name of the threads being created continuously on your > broker? > not using a dedicated task runner is a good idea, as it uses a thread > pool instead. However from what I know the size of that thread pool is > basically unbounded as well, and if all newly created threads are in > use, the broker will just create more threads as needed. > > Can you reproduce the problem in an isolated JUnit test? > > > Torsten Mielke > tors...@fusesource.com > tmie...@blogspot.com > > On Oct 5, 2011, at 1:16 PM, Millies, Sebastian wrote: > > > Hello there, > > > > I'm using an embedded BrokerService with a single destination, > > which is a queue that hands off incoming messages to an SCA > > logging service. > > > > Internally, that logging service follows the producer-consumer > pattern > > with a single blocking queue, so the producer basically gets handed a > > message from the broker and puts a log request on the queue. > > > > The problem: as soon as the producer blocks, the broker starts > > creating thousands of threads, most of which will also block. > > until it runs out of memory. (I have already reduced the stack > > available to each thread with the -Xss option.) > > > > How can I control thread creation in the broker (perhaps by supplying > > my own ThreadPoolExecutor with an upper bound on the maximum pool > size)? > > > > Here's how I create the broker. As you can see, I have already set > > the property "dedicatedTaskRunner" to false. > > > > jmsBroker = new BrokerService(); > > jmsBroker.setUseJmx( true ); > > jmsBroker.setPersistent( false ); > > // only relevant when using persistence > > jmsBroker.setDeleteAllMessagesOnStartup( true ); > > jmsBroker.addConnector( "tcp://logginghost:61619" ); > > jmsBroker.setDedicatedTaskRunner( false ); > > jmsBroker.start(); > > > > -- Sebastian > > IDS Scheer Consulting GmbH > > Geschäftsführer/Managing Directors: Kamyar Niroumand, Ivo Totev > > Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken, > Germany - Registergericht/Commercial register: Saarbrücken HRB 19681 > > http://www.softwareag.com > > > > > > > > IDS Scheer Consulting GmbH > Geschäftsführer/Managing Directors: Kamyar Niroumand, Ivo Totev > Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken, > Germany - Registergericht/Commercial register: Saarbrücken HRB 19681 > http://www.softwareag.com IDS Scheer Consulting GmbH Geschäftsführer/Managing Directors: Kamyar Niroumand, Ivo Totev Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken, Germany - Registergericht/Commercial register: Saarbrücken HRB 19681 http://www.softwareag.com