There are WebLogic settings that take care of this issue. You can set the server to only load up the first N number of messages or X number of bytes to avoid OOM issues. These can be set up by going to the JMSServer config -> Thresholds and Quotas and configure bytes paging or message paging (or both).
Recommendation:
Set Bytes Threshold High to 1048576, set Bytes Threshold Low to 524288, and set Bytes Paging Enabled to true. Set Messages Threshold High to 1000, set Messsages Threshold Low to 500 and set Messages Paging Enabled
to true. This will ensure there is never more than 1 GB and no more than 1000 JMS messages in RAM.
Few forums that would help :
http://forums.bea.com/thread.jspa?threadID=570000795
Few reasons why OutOfMemory error could occur and their related solution.
1. When the producers are faster than consumers.
Quotas can be used to help this situation. Your sender will then receive ResourceAllocationExceptions and the server will stay up.
2. Cache-related OutOfMemoryErrors.
A very important point to consider when setting size is that the heap must be large enough to hold bean instances for all defined EJB caches.
A possible solution for the OutOfMemoryError is to decrease so that the cache removes or passivates beans,before the JVM throws an OutOfMemoryError because the heap is full.
Ref : https://support.bea.com/application_content/product_portlets/support_patterns/wls/InvestigatingCacheFullExceptionForEntityAndStatefulSessionBeansPattern.html
3. Handling the OutOfMemoryErrors.
Message quotas prevent a WebLogic JMS server from filling up with messages and possibly running out of memory, causing unexpected results. Unless the "Blocking Sends" feature has been implemented, when you reach your quota, JMS prevents further sends with a ResourceAllocationException (rather than blocking). You can set quotas on individual destinations or on a server as a whole.
The thresholds are not flow control - though they would be better suited to that application than the quotas. The thresholds are simply settings that when exceeded cause a message to be logged to the console to let you know that you are falling behind.
WebLogic JMS also has a flow control feature that enables a JMS server or destination to slow down message producers when it is becoming overloaded. Specifically, when a JMS server/destination exceeds its specified bytes or messages thresholds, it instructs producers to limit their message flow.
Ref : http://edocs.bea.com/wls/docs81/faq/jms.html#260519
DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.
-----------------------------------------------------------------------------------------------------------------------
Comments
Post a Comment