GAS: memory limit exceeded

I am using Google Apps scripting to generate documents from a template and some data stored in a spreadsheet. It used to work well, but recently (without changing any code) I started getting the following error when calling "google.script.run" from a very simple HTML sidebar:

Execution failed: memory limit exceeded

The error happens during the copying process - it occurs in several different places each time the script is run.

I don't see any references to memory limits in the app script's quotas, and a regular google search doesn't seem to find anything. Can anyone shed some light on this and how to determine the limit / what is holding most of the memory / increase the limit if possible?

Thanks in advance.

+3


source to share


2 answers


Take a look at Quotas for Google Services . Script Services impose daily quotas and hard limits on certain features. If you exceed a quota or limit, your Script will throw an exception and stop executing.



0


source


Check out the methods you are using to get the data ranges.



i.e. if you use sheet.getRange (A: X) it will get all the rows on the sheet, even empty ones (probably on the order of tens of thousands or even hundreds of thousands). This is the best use case for the getDataRange method, which gets the last column and last row of data.

0


source







All Articles