# Problem with mautic:segments:update out of memory Mautic5

**URL:** <https://forum.mautic.org/t/problem-with-mauticupdate-out-of-memory-mautic5/31781>\
**Category:** Product Support\
**Created:** [April 22, 2024, 3:56pm UTC](https://forum.mautic.org/t/problem-with-mauticupdate-out-of-memory-mautic5/31781 "2024-04-22T15:56:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgaido](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mgaido/32/13309_2.png) [@mgaido](https://forum.mautic.org/u/mgaido)\
**Post date:** [April 22, 2024, 3:56pm UTC](https://forum.mautic.org/t/problem-with-mauticupdate-out-of-memory-mautic5/31781/1 "2024-04-22T15:56:14Z")

</div>

**Your software**  
My Mautic version is: v5.0.4  
My PHP version is: 8.0.30  
My Database type and version is: RDS MySQL 8.0.35

**Your problem**

I was testing the new version of Mautic 5.0.4, and whenever I try to create several segments of approximately 50k contacts, the server always ends up running out of memory. I’ve been investigating what could be causing this, and I noticed that as the `mautic:segments:update` process runs, the percentage of memory usage keeps increasing until the server runs out of memory. It’s an EC2 instance on AWS running with a t4g.medium (4GB RAM). What could be happening?

Steps I have tried to fix the problem:

1. Create many contacts
2. Create some segments
3. Wait until process mautic:segments:update runs

---

<div class="post-metadata">

**Author:** ![marcus42](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@marcus42](https://forum.mautic.org/u/marcus42)\
**Post date:** [April 22, 2024, 5:58pm UTC](https://forum.mautic.org/t/problem-with-mauticupdate-out-of-memory-mautic5/31781/2 "2024-04-22T17:58:52Z")

</div>

Probably happening exactly what the error is stating: Out of Memory.

Increase your PHP allocated RAM to the right amount (this is specific to your setup) and it should be all good.

---

<div class="post-metadata">

**Author:** ![jpgiron](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jpgiron/32/1751_2.png) [@jpgiron](https://forum.mautic.org/u/jpgiron)\
**Post date:** [April 22, 2024, 7:05pm UTC](https://forum.mautic.org/t/problem-with-mauticupdate-out-of-memory-mautic5/31781/3 "2024-04-22T19:05:35Z")

</div>

Can you post the .log of the server or .log of mautic?

---

<div class="post-metadata">

**Author:** ![mgaido](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mgaido/32/13309_2.png) [@mgaido](https://forum.mautic.org/u/mgaido)\
**Post date:** [April 22, 2024, 8:43pm UTC](https://forum.mautic.org/t/problem-with-mauticupdate-out-of-memory-mautic5/31781/4 "2024-04-22T20:43:27Z")

</div>

I dont see anything in the mautic logs. The problem is not the PHP allocated Ram, the problem is that the `mautic:segments:update` process consume all the memory of the server.  
I did the same installation that I had done with version 4, and the process never consumed that much memory in v4.

 ![State3](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/6/69fd8e4e117a760025913a6ba4302fd6e3a85019.png)  
 ![State2](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/f/ff6402e895f0b06294974a6c574b5265b28c30b7.png)  
 ![State1](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/6/64df201b5b81659f0e84ebb3cf8eb1ed4535de55.png)

---

<div class="post-metadata">

**Author:** ![marcus42](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@marcus42](https://forum.mautic.org/u/marcus42)\
**Post date:** [April 22, 2024, 9:35pm UTC](https://forum.mautic.org/t/problem-with-mauticupdate-out-of-memory-mautic5/31781/5 "2024-04-22T21:35:48Z")

</div>

Then you probably want to trace the process.
