# MySQL-server-5.6.33-1.el7.x86\_64 hihm memory usage

**URL:** <https://forums.percona.com/t/mysql-server-5-6-33-1-el7-x86-64-hihm-memory-usage/6471>\
**Category:** Percona Server for MySQL 5.6\
**Created:** [July 22, 2018, 11:28pm UTC](https://forums.percona.com/t/mysql-server-5-6-33-1-el7-x86-64-hihm-memory-usage/6471 "2018-07-22T23:28:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zarere](https://avatars.discourse-cdn.com/v4/letter/z/ac8455/32.png) [@zarere](https://forums.percona.com/u/zarere)\
**Post date:** [July 22, 2018, 11:28pm UTC](https://forums.percona.com/t/mysql-server-5-6-33-1-el7-x86-64-hihm-memory-usage/6471/1 "2018-07-22T23:28:26Z")

</div>

Hi there,

I’m using the above MySQL and the memory usage is bigger than what mysqltunner reports.According to mysqltuner the max memory usage can go up to [OK] Maximum possible memory usage: 6.6G (43.44% of installed RAM)  
but currently the rss RAM used 10G and the VSZ is even bigger 30GB

According to some of your articles  
[https://www.percona.com/blog/2016/05](https://www.percona.com/blog/2016/05)…-memory-usage/

If the VSZ size is above 90% of the installed memory that can be a problem.

ps -eo pmem,pcpu,vsize,rss,pid,cmd | sort -k 1 -nr | head -1  
65.5 11.9 30545552 10509912 13037 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld.log --open-files-limit=10000 --pid-file=/var/lib/mysql/db2.pid --socket=/var/lib/mysql/mysql.sock --port=3306

I see that almost 500MB are used from performance schema but where are the other 3GB being used?What I saw is that there are a lot of Sleep Threads.Example:

±------------------±------+  
| Variable\_name | Value |  
±------------------±------+  
| Threads\_cached | 12 |  
| Threads\_connected | 101 |  
| Threads\_created | 38480 |  
| Threads\_running | 2 |  
±------------------±------+

So from 101 Threads\_connected only 2 from them are running and the other 99 are in Sleep State.If I change the default values on wait\_timeout and interactive\_timeout to 60 seconds is that going to effect the replication since I’m using master/master active-passive replication?So the main questions are where are these 3GB being used from 7GB to 10GB and is there be problem with the replication if I reduce the timeouts to 60 seconds?Please advise.

When I run flush tables the VSZ memory goes rapidly down.It was 30GB and after flush tables it went to 22GB.Please advise .There are no slow queries detected in my slow log.

P.S.

perl /home/ocsupport/numa-maps-summary.pl \< /proc/$(pidof mysqld)/numa\_maps  
N0 : 1377443 ( 5.25 GB)  
N1 : 1201461 ( 4.58 GB)  
active : 1336345 ( 5.10 GB)  
anon : 2575571 ( 9.83 GB)  
dirty : 2575575 ( 9.83 GB)  
kernelpagesize\_kB: 2404 ( 0.01 GB)  
mapmax : 657 ( 0.00 GB)  
mapped : 3424 ( 0.01 GB)

[my\_cnf.txt](https://forums.percona.com/uploads/short-url/51v54MO4celSKXyBCqo1ULugsiq.txt) (2.16 KB)

[mysqltuner.txt](https://forums.percona.com/uploads/short-url/xkoJ56AruSsD9BwxPUMy5zXWBJA.txt) (8.24 KB)

[pt-mysql-summar.txt](https://forums.percona.com/uploads/short-url/8tZ7PjVOhIPax3zg5FHHQk8YrvE.txt) (20.6 KB)

[pt-summary.txt](https://forums.percona.com/uploads/short-url/73FDAPLA44wn6BCeftHTlC7H28W.txt) (17.3 KB)

---

<div class="post-metadata">

**Author:** ![zarere](https://avatars.discourse-cdn.com/v4/letter/z/ac8455/32.png) [@zarere](https://forums.percona.com/u/zarere)\
**Post date:** [July 23, 2018, 1:52am UTC](https://forums.percona.com/t/mysql-server-5-6-33-1-el7-x86-64-hihm-memory-usage/6471/2 "2018-07-23T01:52:12Z")

</div>

Since the Stored procedures memory can not be limited is there a chance the high number of stored procedures to be the reason for that high memory usage.

I’m having about 110 per sond on the server:

```auto
mysqladmin ext -ri1 -p |grep Com_call_procedure

| Com_call_procedure | 112 |
| Com_call_procedure | 124 |
| Com_call_procedure | 129 |
| Com_call_procedure | 117 |
| Com_call_procedure | 113 |
| Com_call_procedure | 112 |
| Com_call_procedure | 112 |
| Com_call_procedure | 113 |

```

---

<div class="post-metadata">

**Author:** ![zarere](https://avatars.discourse-cdn.com/v4/letter/z/ac8455/32.png) [@zarere](https://forums.percona.com/u/zarere)\
**Post date:** [July 23, 2018, 2:34am UTC](https://forums.percona.com/t/mysql-server-5-6-33-1-el7-x86-64-hihm-memory-usage/6471/3 "2018-07-23T02:34:10Z")

</div>

I just found maybe a related issue

[url][https://bugs.launchpad.net/percona-server/+bug/1380985[/url]](https://bugs.launchpad.net/percona-server/+bug/1380985%5B/url%5D)  
[url][[PS-826] LP #1380985: Execution of stored procedures with subqueries leaks memory - Percona JIRA](https://jira.percona.com/browse/PS-826%5B/url%5D)

but I’m using MySQL community edition and MySQL version is also bigger the the reported one.
