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"
class="org.apache.activemq.pool.PooledConnectionFactory">
                <property name="connectionFactory">
                        <bean 
class="org.apache.activemq.ActiveMQConnectionFactory">
                                <property name="brokerURL"
value="vm:(broker:(tcp://localhost:6001)?persistent=false)" />
                        </bean>
                </property>
        </bean> 
    <bean id="messageReceiver"
class="tv.nation217.phoenix.services.messaging.MessageReceiver" />
    <bean id="callerWarningListener"
class="org.springframework.jms.listener.adapter.MessageListenerAdapter">
        <property name="delegate" ref="messageReceiver"/>
        <property name="defaultListenerMethod"
value="onCallerWarningReceive"/>
    </bean>
        <bean id="callerWarningContainer"
class="org.springframework.jms.listener.SimpleMessageListenerContainer">
        <property name="connectionFactory" ref="connectionFactory"/>
        <property name="messageListener" ref="callerWarningListener"/>
        <property name="destinationName" value="callerWarningQ"/>
    </bean>
    <!-- three more consumers... -->

And this is the producer Spring config:

        <bean id="connectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory">
                <property name="connectionFactory">
                        <bean 
class="org.apache.activemq.ActiveMQConnectionFactory">
                                <property name="brokerURL" 
value="tcp://localhost:6001" />
                        </bean>
                </property>
        </bean>
        <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
            <property name="connectionFactory" ref="connectionFactory" />
        </bean>
        <bean id="messageProducer"
class="tv.nation217.phoenix.poller.messaging.MessageProducer">
                <property name="jmsTemplate" ref="jmsTemplate"/>                
        
        </bean>


Do you see anything wrong in here?

Many thanks,
Alex.




James.Strachan wrote:
> 
> On 4/17/07, Ale Sarco <[EMAIL PROTECTED]> 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).
> http://activemq.apache.org/how-do-i-use-jms-efficiently.html
> 
> Just up the file descriptors setting on your OS and it should fix this
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/3.1-broker-OutofMemoryError-%3A-unable-to-create-new-native-thread-tf3527977s2354.html#a10136935
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to