activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ale Sarco <>
Subject Re: 3.1 broker OutofMemoryError : unable to create new native thread
Date Mon, 23 Apr 2007 09:57:10 GMT

Hi James,

It happened again friday night on a different production server (same
application). I have duplicated the file handlers (to 103062) for the OS
(Fedora Core 3), but it seems like the important setting here is a per user
setting, since whenever this happens, I cannot login into the account in
which Tomcat is running (Resource temporarily unavailable), but I can to any
other, until I shut Tomcat down. The used file handlers at the time of the
exception was just 3090. 

Anyway, apart from the file handlers setting, I think something must be
wrong with my configuration.
This is my Spring consumer config:

	<bean id="connectionFactory"
		<property name="connectionFactory">
			<bean class="org.apache.activemq.ActiveMQConnectionFactory">
				<property name="brokerURL"
value="vm:(broker:(tcp://localhost:6001)?persistent=false)" />
    <bean id="messageReceiver"
class="" />
    <bean id="callerWarningListener"
        <property name="delegate" ref="messageReceiver"/>
        <property name="defaultListenerMethod"
	<bean id="callerWarningContainer"
        <property name="connectionFactory" ref="connectionFactory"/>
        <property name="messageListener" ref="callerWarningListener"/>
        <property name="destinationName" value="callerWarningQ"/>
    <!-- three more consumers... -->

And this is the producer Spring config:

	<bean id="connectionFactory"
		<property name="connectionFactory">
			<bean class="org.apache.activemq.ActiveMQConnectionFactory">
				<property name="brokerURL" value="tcp://localhost:6001" />
	<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
	    <property name="connectionFactory" ref="connectionFactory" />
	<bean id="messageProducer"
		<property name="jmsTemplate" ref="jmsTemplate"/>			

Do you see anything wrong in here?

Many thanks,

James.Strachan wrote:
> On 4/17/07, Ale Sarco <> wrote:
>> Hi James,
>> Using ActiveMQ 4.1.1 with Spring I experienced this "unable to create new
>> native thread" exception in one of my production servers last night. The
>> thing is that server does not has a large messaging traffic, it just send
>> 2
>> or 3 messages every couple of minutes to another webapp running in the
>> same
>> Tomcat, and this is only for 2 hours a day, and there were plenty of
>> memory
>> available on the heap for that VM.
>> I agree that is probably related to the file descriptors that you
>> mentioned,
>> because when I tried to log in to that server via SSH I got an error
>> about
>> something like "insufficient resources". Only when I restarted the webapp
>> I
>> was able to login again.
>> Now, what file descriptors is this about? Is a (logical) file created
>> somewhere every time a message is sent? If so, how do I avoid this
>> problem,
>> I guess they should be reused or something?
> File descriptors are often used for various things in the OS; files,
> sockets, sometimes threads etc. ActiveMQ does not create a file or
> socket per message :).
> BTW how do things look in jconsole; do you have lots of connections on
> your broker? I wonder if you are not closing connections after they
> have been used (you are really meant to only use a small number of
> connections and lots of sessions).
> Just up the file descriptors setting on your OS and it should fix this
> -- 
> James
> -------

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message