I’m working with txt files on google drive: adding text from file B at the end of file A. Ectualy doing it by downloading text from file A then upend it with file B and insert it back to file A. The file A is now more then 7 MB and the flow crushs wit “n8n may have run out of memory while running this execution“. Do you know what the limitations are or may be how can I avoide the issue?
Hi @AndrAnt i think the best approach for this problem will be to set N8N_DEFAULT_BINARY_DATA_MODE=filesystem and this should solve the problem you were having with your approach but if you are on a cloud instance consider upgrading your plan, and also you can try an approach where you download the file B which is much smaller and UPDATE the file A with the contents of file B, this might be able to process it faster without costing much ram.
The ‘Out of Memory’ error occurs because n8n is processing the 7MB+ string directly in RAM. Here is the shortest fix:
1. Use ‘Execute Command’ (Best for Self-Hosted): Don’t merge strings in n8n. Use the Linux command: cat fileB.txt >> fileA.txt This streams the data directly without using n8n’s memory.
2. Increase RAM Limit: Set this Environment Variable to give n8n more space: NODE_OPTIONS=--max-old-space-size=4096
3. Use a Database: If the file keeps growing, move the text to Supabase or PostgreSQL. Appending rows to a database is infinitely more stable than appending to a .txt file