Fetch stop limit memory errors

A Java™ virtual memory heap out-of-memory error is caused by an operation that fetches and constructs too many objects into one Maximo® business object (MBO) set. This type of error can disconnect all users from the server. You can use the mxe.db.fetch system properties to configure the fetch limit, which can help prevent out-of-memory errors.

You use the fetch stop limit properties to set an upper limit on the number of objects that are fetched from the database and constructed on the server into a single set. You can set different limits for different types of objects. When the upper limit is reached, an exception is thrown so that the process is stopped. You can then either reduce the number of objects by using filters or change the operation to prevent the database from fetching too many objects.

The fetch stop limit is enabled by default with a limit of 5000 for all objects. If the fetch stop limit is reached and the exception is thrown during a user interface operation, the error message is typically shown to the user. Depending on how the outer logic is implemented, this message might be wrapped by another message or not shown. However, the error is always logged on the server.

Scenarios where fetch stop limit errors occur

Large fetch counts that cause errors typically occur in two scenarios:

  • When you apply an action to a large result set. The result set is retrieved without sufficient filtering. This error can occur when you mistakenly start a list page action or when a legitimate operation loads too many objects.
  • Where an operation embedded in a user action retrieves a large set of objects and the data cannot be filtered.

Actions to take when fetch limit stop errors occur

Analyze the data and identify the operation that causes the error. You can try to correct the error by filtering the data or by splitting the target of the action into smaller batches. If the error cannot be corrected, the administrator must adjust the system in one or more of the following ways:

  • Increase the fetch limit for the particular object if it is safe to use a higher limit. If you do not want other user operations to be capped by this high number, you can call the MboSet.setLogLargFetchResultDisabled(true) method on the MBO set.
  • Correct the data to avoid processing such a large data set.
  • Use discardable MBO sets to prevent all the objects from being fetched into memory.
  • Move the operation into a cron task and schedule the cron task to run at a low-demand time or on another server.
  • Modify the process so that it fetches fewer objects.