If you are facing error during inventory closing or cancellation of recalculation then you need to refer below TechNet site: http://blogs.msdn.com/b/emeadaxsupport/archive/2009/06/15/error-executing-code-insufficient-memory-to-run-script.aspx If problem still exists then you need to select lesser period range.
Microsoft Dynamics Ax,AIF,Axapta, Enterprise portal,,Microsoft , United State,U.S., SharePoint , BI Tools, Performance Tuning, SSRS,Business Logic,Ax ERP Errors and solution,Dynamics 365 Errors Solution,Business software .