we're seeing memory limitation issues every now and then when creating scripts, particularly when working with files/documents.
I've isolated the error into this simple script. It crashes in SOD, but not in Online. I assume because the memory limitation is higher in Online.
String url = "https://upload.wikimedia.org/wikipedia/commons/2/2d/Snake_River_%285mb%29.jpg";
Byte response = http.get(url);
Integer i = 10;
This script downloads a file that is about 5MB, and puts the result into a Byte array.
In SOD it crashes with:
EjScript::RunTimeException: Script is taking too much memory: 247008Kb
247MB of RAM seems a bit excessive when downloading 5MB...?
Also note, that the last line in the script needs to be there to trigger the error, for some weird reason.
I'm thinking there might be some sub-optimal memory management happening in the background here?