Intermittent 'Code exceeded the 192MiB memory limit (OutOfMemoryError)' errors occur when JavaScript reads and parses a ~14.3 MB CSV from a GCS resource (a ~20 million-character Base64 response body); the identical code and file sometimes succeed and sometimes fail, and there is a question of how to stream/chunk-read large GCS files.
AI Response
The 192MiB ceiling is a fixed per-execution memory budget for code running in Retool's sandbox, and a ~20M-character Base64 body plus the decoded buffer plus the parsed rows can sit right at that edge — which is why the same code/file passes or fails depending on when garbage collection runs. Retool JavaScript does not expose true streaming for a resource response, so the response body is materialized in memory before your code can process it. The practical workaround is to avoid holding the whole payload at once: request the object in byte ranges / smaller pieces and decode-and-parse each chunk incrementally rather than decoding the entire Base64 body first, or offload the heavy parsing to a Workflow (which has higher, configurable memory limits) or to your own backend. Because the workload is essentially at the memory boundary, reducing peak memory (chunked reads, releasing intermediate variables, not retaining decoded strings) is the reliable fix rather than expecting consistent success at this size.
The Community Team is testing out a new automation. Let us know if it's helpful (or not) by leaving a , , or . Or by marking this post as the "Solution"! Let us know if you have any feedback here.