• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JMS Service not releasing resources

 
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 312
MS IE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please post code for faster assistance.
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
MS IE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic