2

I'm creating serverless httptrigger function in azure. And then I execute the function by http get call.

My function executes just fine. But if during runtime there is too many data loaded then I get JavaScript heap out of memory error.

In my local env if I get the issue I can increase the heap size by the command

NODE_OPTIONS=--max-old-space-size=4096

But how I can do the same in the azure environment? Is there any way to connect the azure environment by command line? Or in the azure UI do we have any option to set up the heap size for azure env?

enter image description here

Indranil Mondal
  • 2,799
  • 3
  • 25
  • 40

1 Answers1

3

I get JavaScript heap out of memory error.

To avoid the issue, follow the below step:

Add languageWorkers:node:arguments in environment variables. In the Azure Portal > Function App > Configuration > Application Settings > New Application Setting

As @empz mentioned in GitHub -> add the app setting languageWorkers:node:arguments (use languageWorkers__node__arguments for Linux function apps) with a value of --max-old-space-size=<max memory in MB>

enter image description here

Refer to the GitHub Az Function Node Heap Memory Issue 68614 for more information.

Delliganesh Sevanesan
  • 4,146
  • 1
  • 5
  • 15