[JBoss-user] [Messaging, JMS JBossMQ] - Re: org.jboss.mq.SpyJMSException: OutOfMemoryError
Hi all, I got the same problem with you guys if i just close only the Session. But after i do the close for all include the Sender and Connection it looks OK. I was ran out of Memory after 1000 message post to the queue. Here is what i do with my sendObject: public static void sendObject(Serializable object, String jvmURL, String queueName) throws NamingException, JMSException { PSServiceLocator locator = new PSServiceLocator(jvmURL); //lookup the resources QueueConnectionFactory connectionFactory = (QueueConnectionFactory)locator.lookupObject(CONNECTION_FACTORY); Queue queue = (Queue)locator.lookupObject(queueName); //safe jms resources QueueConnection queueConnection = null; QueueSession queueSession = null; QueueSender queueSender = null; try { //create the session connection queueConnection = connectionFactory.createQueueConnection(); //instance the queue session queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); //create queue and send the message queueSender = queueSession.createSender(queue); Message message = queueSession.createObjectMessage(object); queueSender.send(message); }finally { //free all created objects if(queueSender != null) { queueSender.close(); } if(queueSession != null) { queueSession.close(); } if(queueConnection != null) { queueConnection.close(); } } } Hope it helps you all, View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3901248#3901248 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3901248 --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Messaging, JMS JBossMQ] - Re: org.jboss.mq.SpyJMSException: OutOfMemoryError
Did you already solved the problem? We get the same error, but in combination with an OutOfMemoryError: Caused by: org.jboss.mq.SpyJMSException: Cannot get a client ID; - nested throwable: (java.lang.reflect.UndeclaredThrowableException) at org.jboss.mq.Connection.askForAnID(Connection.java:1119) at org.jboss.mq.Connection.checkClientID(Connection.java:1092) at org.jboss.mq.SpyConnection.createQueueSession(SpyConnection.java:175) at at.sozvers.eweko.service.impl.DomeaJMSClientServiceImpl.createQueueSession(DomeaJMSClientServiceImpl.java:69) at at.sozvers.eweko.service.impl.DomeaJMSClientServiceImpl.forwardDoc(DomeaJMSClientServiceImpl.java:113) ... 73 more Caused by: java.lang.reflect.UndeclaredThrowableException at org.jboss.mq.il.uil2.msgs.BaseMsg.setError(BaseMsg.java:301) at org.jboss.mq.il.uil2.SocketManager$ReadTask.replyAll(SocketManager.java:445) at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleStop(SocketManager.java:399) at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:344) ... 1 more Caused by: java.lang.OutOfMemoryError: unable to create new native thread at java.lang.Thread.start(Native Method) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor.addThread(PooledExecutor.java:520) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor.execute(PooledExecutor.java:880) at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:298) ... 1 more Any Idea? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3899615#3899615 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3899615 --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Messaging, JMS JBossMQ] - Re: org.jboss.mq.SpyJMSException: OutOfMemoryError
Check this out: http://wiki.jboss.org/wiki/Wiki.jsp?page=OutOfMemoryExceptionWhenCannotCreateThread View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3899616#3899616 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3899616 --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Messaging, JMS JBossMQ] - Re: org.jboss.mq.SpyJMSException: OutOfMemoryError
I thought it is expensitive too until I measured the time. After getting the connection the first time it always takes just 1-2 ms (at maximum 15 ms). It seems the ConnectionFactory is caching the connection. In my opinion everything should work fine if they wouldn't be that strange error I reported. I'm not pretty sure what do mean with play around with server disconnect problem ? Therefore I would like to ask you what is your advice ? View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3874777#3874777 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3874777 --- This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Messaging, JMS JBossMQ] - Re: org.jboss.mq.SpyJMSException: OutOfMemoryError
I have already thought of it. But I am closing the connection in a finally block within the send method. I can't do it any longer if I move the statement connection = cf.createConnection(); outside the send method because of IllegalStateException (or something similar like that). But I have to do it. I think I have two possibilities: 1.) Open for each request a new connection which I have to close after sending the message (current situation). This should work fine (and it does without heavy load. I am not even able to reproduce the error. Sometimes it happens, sometimes it doesn't happen) 2.) Implementing a connection pool. What do you think ? View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3874583#3874583 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3874583 --- This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Messaging, JMS JBossMQ] - Re: org.jboss.mq.SpyJMSException: OutOfMemoryError
We were doing 1) but it is very expensive. I am switching over to 2) which is easy until you play around with server disconnect problem. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3874725#3874725 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3874725 --- This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Messaging, JMS JBossMQ] - Re: org.jboss.mq.SpyJMSException: OutOfMemoryError
The JMS Client does not use connection pooling. It does something like that: | public void send(...){ | lookupJMSResourcen(); | connection = cf.createConnection(); | session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE); | ... | } | | private static void lookupJMSResourcen() throws Exception{ | if (ic == null) | ic = new InitialContext(); | if (cf == null) | cf = (ConnectionFactory) ic.lookup(CONNECTION_FACTORY); | if (destination == null) | destination = (Destination) ic.lookup(QUEUE); | } | | The JMS Server is a message driven bean. It is not easy to reproduce the error. Any ideas ? View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3874481#3874481 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3874481 --- This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Messaging, JMS JBossMQ] - Re: org.jboss.mq.SpyJMSException: OutOfMemoryError
Move the connection = cf.createConnection(); outside of the send. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3874503#3874503 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3874503 --- This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Messaging, JMS JBossMQ] - Re: org.jboss.mq.SpyJMSException: OutOfMemoryError
Did you find any solution ? View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3874253#3874253 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3874253 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Messaging, JMS JBossMQ] - Re: org.jboss.mq.SpyJMSException: OutOfMemoryError
Are you using connection pooling? It seems like you are not and are running out of ability to create new tcp sockets. Would be interested if your test still fails if you use only one connection for all messaging. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3874383#3874383 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3874383 --- This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Messaging, JMS JBossMQ] - Re: org.jboss.mq.SpyJMSException: OutOfMemoryError
I got the similar error with single JMS client and JMS listener. I just send 1000 messages continuously (sleep 50ms before send a message) . The listener stops receiving message after about 600 messages. The listener doesn't really do anything. It just receives message and print out timestamp. The message size is 1K. Jboss version 4.0.1sp1. Tested with OpenJMS fine with 10,000 messages with 100K message size. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=3874140#3874140 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3874140 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user