Hi,
After I found the problem ($title) I read in forums that "there is an upper limit on the number of operating system threads that can be opened by one process".
Searching deaper I encountered that the error ocures when I'm writing to the queue many messages in short time.
So I made a stress test, sending ObjectMessages to a queue with Spring Frameworks's JmsTemplate. I also created an MDB to listen for the messages on the specified queue. The queueing is transient and transactional. The application server that I use is jboss-4.0.1sp1 under Windows XP SP2. I count the number of the threads with the following command: typeperf "Process(java)\Thread Count" -si 2, this command will write to the screen the number of threads in the jboss in every 2 seconds (the number of the threads can be seen from the task manager too).
After I start the test the number of the threads are rising in big steps until I get the OutOfMemoryError:
"11/15/2005 09:26:34.540","60.000000"
"11/15/2005 09:26:36.543","60.000000"
"11/15/2005 09:26:38.546","60.000000"
"11/15/2005 09:26:40.609","63.000000"
"11/15/2005 09:26:42.632","229.000000"
"11/15/2005 09:26:44.645","424.000000"
"11/15/2005 09:26:46.658","617.000000"
"11/15/2005 09:26:48.661","804.000000"
"11/15/2005 09:26:50.664","1033.000000"
"11/15/2005 09:26:52.667","1258.000000"
"11/15/2005 09:26:54.670","1472.000000"
"11/15/2005 09:26:56.683","1641.000000"
"11/15/2005 09:26:58.686","1861.000000"
"11/15/2005 09:27:00.689","2085.000000"
"11/15/2005 09:27:02.692","2291.000000"
"11/15/2005 09:27:04.705","2498.000000"
"11/15/2005 09:27:06.708","2717.000000"
"11/15/2005 09:27:08.731","2924.000000"
"11/15/2005 09:27:10.744","3102.000000"
"11/15/2005 09:27:12.747","3301.000000"
"11/15/2005 09:27:14.760","3483.000000"
"11/15/2005 09:27:16.783","3676.000000"
"11/15/2005 09:27:18.796","3847.000000"
"11/15/2005 09:27:20.809","3886.000000"
"11/15/2005 09:27:22.812","3886.000000"
"11/15/2005 09:27:24.815","3886.000000"
So I made the same test with standard jms, without using the JmsTemplate and this problem doesn't occure, actualy the number of threads are not rising.
The other interesting thing is that it's faster then using the JmsTemplate (1000 messages with standard jms was sent in ~3 sec. and with spring framework in ~19 sec).
Here is my code using JmsTemplate:
I also tried that the MessageCreator was created outside the for loop but the problem is the same.Code:JmsTemplate jmsTemplate= new JmsTemplate(connectionFactory); jmsTemplate.setSessionTransacted(true); jmsTemplate.setDeliveryMode(DeliveryMode.NON_PERSISTENT); for (int i = 0; i < 5000; i++) { jmsTemplate.send(m_queue, new MessageCreator() { public Message createMessage(Session session) throws JMSException { return session.createObjectMessage("temp"); } }); }
Could this be a configuration problem? What am I doing wrong?
I looked after this problem through the net but I didn't find any respons.
Thanks,
szegedics


Reply With Quote