web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Error executing code: insufficient memory to run script - AX 4.0 SP2

(0) ShareShare
ReportReport
Posted on by 1,185

Hi All.  I receive the above error when running a Financial Statement.  The Financial statement uses the account as the main focus and department - cost centre - purpose as the secondary focus.  The row definition only contains a range of ledger accounts, subtotalled.

I have seen posts regarding this error, but they all relate to AIF or file import sizes - suggesting to edit the registry for the maxbuffer size on the client and AOS.  Does this also relates to this error we are having?

I have looked at the AOS memory consumption during the running of the report and when the memory hits 1.5G, the error is thrown, causing the AOS to crash.

Regards

Eddie

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Ajit Profile Picture
    8,755 on at
    Re: Error executing code: insufficient memory to run script - AX 4.0 SP2

    Eddie,

    Try by increasing maxbuffer size.

  • Suggested answer
    Martin Dráb Profile Picture
    236,802 Most Valuable Professional on at
    Re: Error executing code: insufficient memory to run script - AX 4.0 SP2

    The error is actually related to assignments to variables, so it's not technically bound to AIF or file imports or anything else. It's just because loading or generating files is the most common case where you need a variable with several megabytes of data. More technical details here.

    You have two options:

    • To increase the limit. It doesn't really solve the cause but it may be fully sufficient for you.
    • Redesign the implementation so it doesn't try to assign all data to the variable. It may resolve the problem completely, but it may also be a lot of work.
  • Eddie Josling Profile Picture
    1,185 on at
    Re: Error executing code: insufficient memory to run script - AX 4.0 SP2

    Thanks.  To what size in MB do you suggest we set this key?  I read that it is not recommend to set it to zero (0).

    Eddie

  • Martin Dráb Profile Picture
    236,802 Most Valuable Professional on at
    Re: Error executing code: insufficient memory to run script - AX 4.0 SP2

    It depends on how much memory your process needs. In general, you want to set it to the lowest value where you're not getting into troubles with "insufficient memory". You will have to experiment.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
AlissonGodoy Profile Picture

AlissonGodoy 2

#2
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans