Skip to main content

Troubleshooting Guide: Resolving System.OutOfMemoryException Application Errors

Distributor admin troubleshooting for System.OutOfMemoryException errors in Encompass, often during large AP closes, exports or file loads: split work into smaller batches, check memory limits. Requires v26.01+.

B
Written by Bailey Naas-Thornton

Minimum Version Required: 26.01

Pre-Conditions

  • System Access: Must have administrative access to the server, application hosting environment (e.g., IIS, Docker containers), or system monitoring tools.

  • Log Access: Requires access to system and application error logs to identify the exact timestamp and context of the exception.

  • Environment Knowledge: Basic understanding of the application's current environment configuration (e.g., container memory limits, worker process architecture).

Steps

  • Monitor Environment Resource Pressure: Check the host server or container environment for overall memory usage. Determine if the application pool or container has a strict memory limit, or if the application is running on a 32-bit worker process which restricts maximum available memory.

  • Identify the Triggering Action: Review the application logs to pinpoint exactly what was happening when the exception occurred. Look for actions such as a large Accounts Payable (AP) close, massive file operations, or complex data exports.

  • Review Large File Operations: If the error occurs during file handling, verify the size of the files being processed. The system may be attempting to load an excessively large file entirely into memory.

  • Analyze Data Aggregation and AP Closes: If the error occurred during an AP close, check if the system was attempting to process a massive batch of shipment lists or production orders at once. Attempt to break the close or the data export into smaller, manageable batches rather than processing the entire dataset simultaneously.

  • Contact Support: If the issue persists after evaluating the environment and attempting to process smaller data batches, please contact technical support. To ensure efficient troubleshooting, gather and provide the following information:

    • Exact error messages or codes encountered (including the full stack trace of the System.OutOfMemoryException).

    • Screenshots or video recordings of the issue occurring, if reproducible via the user interface.

    • Log files (Application logs, Windows Event Logs, or container logs covering the time of the error).

    • The exact steps taken by the user that led to the issue.

    • The date and time the issue was first observed and any recurrence patterns.

    • Any changes made to the system before the issue appeared (e.g., server updates, configuration changes, or unusual data volume increases).

Fields And Definitions

  • System.OutOfMemoryException: A critical system error indicating that the application has exhausted all available Random Access Memory (RAM) allocated to it and cannot allocate more memory for continuous execution.

  • AP Close: The Accounts Payable period close process. In this context, it often involves executing complex database queries and gathering large lists of shipments and production orders.

  • SQL2Rs Loops: A process where database query result sets are translated and materialized directly into application memory.

  • GROUP_CONCAT: A database function used to concatenate multiple string values from a group into a single, often very large, string.

  • Worker Process: The underlying system process running the application. A 32-bit worker process has a hard memory limit (typically around 2GB to 4GB), regardless of the host server's total physical RAM.

Best Practices

  • Batch Processing: Avoid processing massive datasets or performing extremely large AP closes all at once. Implement workflows that process data in smaller, paginated batches to keep memory consumption stable.

  • Environment Optimization: Ensure your application is running in a 64-bit worker process to utilize the full memory capacity of your host server. Regularly review and optimize container or application pool memory limits.

  • Limit HTML Generation: Be cautious of generating massive HTML outputs (like rendering thousands of error messages or massive data tables on a single page) as string accumulations quickly consume memory.

  • Proactive Monitoring: Implement application performance monitoring (APM) tools to track memory spikes and high concurrency events, allowing administrators to intercept runaway memory consumption before an exception crashes the process.

Did this answer your question?