Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JMS Service not releasing resources  RSS feed

 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a JMS Service that handles DB query data fetching and setting them in Objects and returning the ArrayList of Objects (~3000 of size) to the calling client. I use active mq to implement the JMS. My doubt is my JMS service dies of OutOfMemoryError after handling some requests. Is there a chance that JMS does not release the resources after it sends the messages back to the client. The client and server uses Serialized classes for communication.
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post code for faster assistance.
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are many java files with many lines of codes in them. I dont think I have the possibility of posting it here. Its just a general question i had. Is there a possibility that JMS holds the resources it uses to calculate or address a client request even after replying to the message?
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe, JMS clients can only push and pull messages from a JMS Queue.

If at all resource should be held, it should be held by the client for the duration of push or pull operation.

Also, a JMS Queue may hold the messages for a defined time period, tuning this parameter can result in effective memory utilisation.
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Madhan Sundararajan Devaki wrote:Also, a JMS Queue may hold the messages for a defined time period, tuning this parameter can result in effective memory utilisation.

Thanks Madhan for the reply. I will try to figure out where the parameter to specify time to hold messages is present in ActiveMQ configurations.

Is there a chance JMS message stays in a queue even after the message is sent to the client. Because I can see considerable memory increase every time a request is delegated after to the client?

Thanks,
John
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the stack trace for the issue. Might be an ActiveMQ issue.

Exception in thread "Thread-43" java.lang.OutOfMemoryError: Java heap space
Exception in thread "InactivityMonitor WriteCheck" java.lang.OutOfMemoryError: Java heap space
at java.util.concurrent.SynchronousQueue$TransferStack.snode(SynchronousQueue.java:280)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:335)
at java.util.concurrent.SynchronousQueue.offer(SynchronousQueue.java:846)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:653)
at org.apache.activemq.transport.InactivityMonitor.writeCheck(InactivityMonitor.java:132)
at org.apache.activemq.transport.InactivityMonitor$2.run(InactivityMonitor.java:106)
at org.apache.activemq.thread.SchedulerTimerTask.run(SchedulerTimerTask.java:33)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!