# Avoid OOM for the MySQL Service

**URL:** <https://forums.percona.com/t/avoid-oom-for-the-mysql-service/40185>\
**Category:** Other MySQL® Questions\
**Created:** [February 10, 2026, 2:55pm UTC](https://forums.percona.com/t/avoid-oom-for-the-mysql-service/40185 "2026-02-10T14:55:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lbmdkap](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@lbmdkap](https://forums.percona.com/u/lbmdkap)\
**Post date:** [February 10, 2026, 2:55pm UTC](https://forums.percona.com/t/avoid-oom-for-the-mysql-service/40185/1 "2026-02-10T14:55:15Z")

</div>

Hi

So I have an database (with OK’ish traffic). We sometimes see that the database is killed with OOM, I’ve tried to adjust the OOM score, set to -1000. Unfortunately, this has caused the whole server to crash again, so properly not the best approach. 😆

The server has 8G of memory, and the innodb pool size is set to 4G. So I really dont unstand why the MySQL service basically eats up all the memory. Is it just because of the size / indexes on the MySQL DB ?

If I check the load on the server, it basically uses all 8G (not cached or anything)

```auto
free -m
               total used free shared buff/cache available
Mem: 7936 7398 184 0 352 267
Swap: 2047 77 1970

```

1. What should we monitor for, like inside MySQL ?
2. How can we avoid this? Is the only option really to increase the memory of the server ?

---

<div class="post-metadata">

**Author:** ![Yunus](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/yunus/32/6430_2.png) [@Yunus](https://forums.percona.com/u/Yunus)\
**Post date:** [February 11, 2026, 3:41am UTC](https://forums.percona.com/t/avoid-oom-for-the-mysql-service/40185/2 "2026-02-11T03:41:58Z")

</div>

You should consider checking this blog

> **[What To Do When MySQL Runs Out of Memory](https://www.percona.com/blog/what-to-do-when-mysql-runs-out-of-memory-troubleshooting-guide/)**
>
> There are 3 major reasons why MySQL runs out of memory, and Percona's Principal Consultant Alexander Rubin offers guidance on finding memory leaks.

MySQL does not only use the memory that assigned for buffer pool but other than that it needs the memory for each connections made and for other caches like sorting, joining, temp tables etc.

You should find out where the memory is being utilized.

If there is a leak, you can also try installing Jemalloc library for better memory management

---

<div class="post-metadata">

**Author:** ![lbmdkap](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@lbmdkap](https://forums.percona.com/u/lbmdkap)\
**Post date:** [February 12, 2026, 8:14am UTC](https://forums.percona.com/t/avoid-oom-for-the-mysql-service/40185/3 "2026-02-12T08:14:15Z")

</div>

Thanks for response to this. I will take a look at it. 🙂
