# Loop over items stops before all items in batch are processed

**URL:** <https://community.n8n.io/t/loop-over-items-stops-before-all-items-in-batch-are-processed/32278>\
**Category:** Questions\
**Tags:** out-of-memory\
**Created:** [October 31, 2023, 1:10pm UTC](https://community.n8n.io/t/loop-over-items-stops-before-all-items-in-batch-are-processed/32278 "2023-10-31T13:10:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trash](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/trash/32/29983_2.png) [@Trash](https://community.n8n.io/u/Trash)\
**Post date:** [October 31, 2023, 1:10pm UTC](https://community.n8n.io/t/loop-over-items-stops-before-all-items-in-batch-are-processed/32278/1 "2023-10-31T13:10:48Z")

</div>

Im using a main workflow and a subworkflow to avoid memory issues but the split in batches node is not processing all items it receives from the nocodb node. it received 4141 items from the nocodb node and spits them into batches of 90 but only executes 4 times before stopping.

images are me testing with a different batch count, when I try with 20 it executes 10 times then says “executed successfully”.

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/a/4/a49a90ed07d6644983ea95a0fcbfde3d89a462da.png)  
 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/8/e/8ee42de4a14c2c67ebe12db3c34dd7064a7bef79.png)

---

<div class="post-metadata">

**Author:** ![Trash](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/trash/32/29983_2.png) [@Trash](https://community.n8n.io/u/Trash)\
**Post date:** [October 31, 2023, 2:07pm UTC](https://community.n8n.io/t/loop-over-items-stops-before-all-items-in-batch-are-processed/32278/3 "2023-10-31T14:07:02Z")

</div>

2 issues.

1. turns out it was a memory issue it was just saying executed successfully for some reason.
2. n8n is not using all my resources, I have 8 gb of ram allocated to my machine and n8n crashes when stored memory surpasses 500 mb.

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [November 1, 2023, 12:14pm UTC](https://community.n8n.io/t/loop-over-items-stops-before-all-items-in-batch-are-processed/32278/4 "2023-11-01T12:14:06Z")

</div>

Hi @Trash, glad you figured it out, thanks so much for confirming!

> I have 8 gb of ram allocated to my machine and n8n crashes when stored memory surpasses 500 mb.

Can you confirm how exactly you’re running n8n and how you measure memory consumption? You might need to adjust the `--max-old-space-size=SIZE` setting as suggested [here](https://docs.n8n.io/hosting/scaling/memory-errors/#increase-old-memory).

---

<div class="post-metadata">

**Author:** ![Trash](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/trash/32/29983_2.png) [@Trash](https://community.n8n.io/u/Trash)\
**Post date:** [November 6, 2023, 11:15am UTC](https://community.n8n.io/t/loop-over-items-stops-before-all-items-in-batch-are-processed/32278/5 "2023-11-06T11:15:52Z")

</div>

Ive encountered this issue again. Im running n8n with cloudron and measuring memory consumption with the graphs in settings.

---

<div class="post-metadata">

**Author:** ![Trash](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/trash/32/29983_2.png) [@Trash](https://community.n8n.io/u/Trash)\
**Post date:** [November 6, 2023, 11:30am UTC](https://community.n8n.io/t/loop-over-items-stops-before-all-items-in-batch-are-processed/32278/6 "2023-11-06T11:30:29Z")

</div>

here are my env.sh file configs

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/1/1/11c2ea6069fbbfa36c4d7f6409db66a4a8720c83.png)

---

<div class="post-metadata">

**Author:** ![Trash](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/trash/32/29983_2.png) [@Trash](https://community.n8n.io/u/Trash)\
**Post date:** [November 6, 2023, 11:49am UTC](https://community.n8n.io/t/loop-over-items-stops-before-all-items-in-batch-are-processed/32278/7 "2023-11-06T11:49:50Z")

</div>

here is the memory usage graph. N8n crashes when it surpasses 500 mb

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/2/e/2ecdbd01271ba68df75ff649868fef86eda9ea5a.png)

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [November 7, 2023, 9:24am UTC](https://community.n8n.io/t/loop-over-items-stops-before-all-items-in-batch-are-processed/32278/8 "2023-11-07T09:24:49Z")

</div>

Can you make sure you’re on the latest version of n8n and share your server logs from just before the crash until the crash with [debug logging](https://docs.n8n.io/hosting/logging-monitoring/logging/) enabled?

---

<div class="post-metadata">

**Author:** ![Trash](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/trash/32/29983_2.png) [@Trash](https://community.n8n.io/u/Trash)\
**Post date:** [November 9, 2023, 6:14pm UTC](https://community.n8n.io/t/loop-over-items-stops-before-all-items-in-batch-are-processed/32278/10 "2023-11-09T18:14:37Z")

</div>

here are the logs [Mozilla Community Pastebin/TOsJ3eqG (Plain Text)](https://pastebin.mozilla.org/TOsJ3eqG)

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [November 14, 2023, 1:51pm UTC](https://community.n8n.io/t/loop-over-items-stops-before-all-items-in-batch-are-processed/32278/11 "2023-11-14T13:51:08Z")

</div>

From a quick look, I can’t see n8n crashing (or starting up after a crash). However, I can see a “Maximum call stack size exceeded” error at 2023-11-09T17:55:27.748Z. Is this when your workflow stopped? If not, how exactly did you confirm that n8n itself crashed?
