Views:

Applies to Product – Dynamics 365 Finance


What’s happening?
Batch jobs are ending with errors, but no error details are logged. Additionally, sporadic crashes of BatchAOS with OutOfMemoryException are reported.


Reason:

  • The batch job errors are occurring due to the simultaneous execution of multiple custom batch jobs, which leads to an out-of-memory error. This indicates that the system could not handle the execution of these jobs efficiently.
  • During the execution period of the batch job, the AOS server and batch AOS server were restarted, which may have contributed to the lack of error logging.
     
Resolution:
  • Review the custom batch jobs to ensure that the data sources do not contain null values.
  • Monitor the system's memory usage during batch job execution to identify potential problems.
 
Additionally,
  • Optimize Data Storage:
    • Regularly archive old data to reduce the volume of live data.
    • Use data archiving features to move historical data to long-term storage.
  • Optimize Queries:
    • Use Microsoft SQL indexes to speed up long-running data queries.
    • Avoid complex queries and use out-of-the-box functions whenever possible.
  • Minimize Customizations:
    • Keep customizations to a minimum and ensure they are efficient.
    • Avoid unnecessary custom code that can lead to memory leaks.
  • Apply right LCS Subscription Estimator:
  • Manage Concurrent Users:
    • Schedule resource-intensive tasks during off-peak hours to reduce the load on the system.
    • Implement user load balancing to distribute the workload evenly.
  • Clean Up Obsolete Data:
    • Regularly run cleanup jobs to remove unnecessary data such as executed orders and transaction history.