How to To Prevent the OutOfMemoryError error

How to To Prevent the OutOfMemoryError error

book

Article ID: KB0073516

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix Adapter for Database 7.2.0

Description

Setting of the ADBQueueSize property depends on the size of a single message and the value of the
tibco.env.HEAP_SIZE property, especially when an excessively large number of
records are sent to Subscription Service and the single message size is in the
Mbit-level.
"
Is there a guideline or even better a formula to determine the size of ADBQueueSize?
Also, what is Mbit-level, Mega bit?

Issue/Introduction

Set the adb..ADBQueueSize property in the adbagent.tra file to restrict the internal queue size

Resolution

When the adapter retrieves messages from a transport queue and puts them in the internal queue, if the transport queue contains an excessively large number of messages and the size of the internal queue is not set or set to an excessively large value, the OutOfMemoryError error occurs.
 
To prevent the OutOfMemoryError error, you can set the adb.<sessionName/serviceName>.ADBQueueSize property in the adbagent.tra file to restrict the internal queue size.
 
However, you must set the internal queue size to a reasonable value; if the internal message queue size is set to an excessively small value, the adapter only handles the specified size number of messages at a time and has to wait for the timeout period of 500 ms (default timeout) to handle subsequent messages, which prolongs the message handling process. Setting of the ADBQueueSize property depends on the size of a single message and the value of the tibco.env.HEAP_SIZE property, especially when an excessively large number of records are sent to Subscription Service and the single message size is in the Mbit-level.
 
Size of an internal message queue in the service level. The default value is 1000.
In the previous release, the default value of this property is -1, which indicates that the adapter does not limit the queue size. If you use the default value, when the adapter receives a large number of messages from a TIBCO messaging bus within a short period, in which the receiving speed exceeds the processing speed of the adapter, the OutOfMemory error might occur.
 
To resolve this issue, the default value is changed to 1000 in this release. Even within a short time, the adapter fetches only 1000 rows, which contributes to a reasonable performance of the adapter.
 
Selection of the sessionName or serviceName variable depends on whether you use a separate session. Specify the sessionName variable if you do not use a separate session; specify the serviceName variable if you use a separate session.
 
What is Mbit-level?
Two types of message size in ADB,
1. Mbit Level (large size messages)
2. Byte-level  (Small size messages)