To prevent the out of memory exception, use flow control with regards to the bwengine. There are two options:
1). Use flow control of bwengine.
2). Use the discardPolicy of TIBCO BusinessWorks™ ProcessMonitor (BWPM).
All log messages that have to be discarded due to the unavailability of the messaging layer, are logged into the bwengine’s logfile(s). That means these messages are not really lost. An enhancement request (#1595) has been created for an import tool that allows the user to import these log messages from the bwengine’s logfile(s) into the BWPM Server.