Unfortunately, I have never checked the correct limitation size of the memory. But, in my case, when the memory error occurs, I noticed that there are most cases that the array is created several times. At that time, at first, an array is created, and when I want to use the other array, clear the existing array, and then, use the cleared array. And also, when the values are put and process in an array in the loops, check each element by "slice". By this, it seems that the memory can be saved. By this, I could avoid the memory error with Google Apps Script. If this was not useful information for your situation, I apologize.