Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "Out of memory error" refer to in Google Apps Script?

When a Google Apps Script function fails and returns "Out of memory error", what does that refer to?

Has the code reached a memory max for a particular variable? Does this have to do with the Cache Service? Does this have to do with the Script Database service? Does this have to do with the overall memory of script it self, combination of all the data processed and calculated?

I have found no information on this error and what it refers to.

Any help would be greatly appreciated.

Regards, James

like image 664
James Krimm Avatar asked Oct 21 '22 19:10

James Krimm


1 Answers

The same error I had faced was due to a variable increased in size more than permitted (Although I am not aware what the maximum permitted size is). So I believe its the "memory max for a particular variable reached" case. The workaround I used was to write the stream of data in a google doc instead. Its simple and works without any troubles.

The behavior of Google Apps Script is deceiving (at least for me) at times, ie. not observed consistency in its error messages. Probably one of those instances occurring with you.

like image 197
bhatiaravi Avatar answered Dec 21 '22 11:12

bhatiaravi