# Percona 5.6.14-56 very high memory usage.

**URL:** <https://forums.percona.com/t/percona-5-6-14-56-very-high-memory-usage/3030>\
**Category:** Percona Server for MySQL 5.6\
**Created:** [October 24, 2013, 12:01pm UTC](https://forums.percona.com/t/percona-5-6-14-56-very-high-memory-usage/3030 "2013-10-24T12:01:07Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan2600](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dan2600/32/965_2.png) [@dan2600](https://forums.percona.com/u/dan2600)\
**Post date:** [October 24, 2013, 12:01pm UTC](https://forums.percona.com/t/percona-5-6-14-56-very-high-memory-usage/3030/1 "2013-10-24T12:01:07Z")

</div>

I recently, blindly, updated to Percona 5.6 via the repos. I’m not running a very sophisticated database (it’s a small user group (\<10) mostly for displaying timed data that can be inputed via an php interface). I have a few databases with the average size of less than a MB, the most users that are ever connected at the same time is about 5.

My server is a dedicated VSS with 1GB of ram. Percona 5.5 would use around 200-300MB of ram total when running.

However, after updating to Percona 5.6, when the server starts it instantly uses about 450MB of Physical memory and 1.5GB of virtual memory. These amounts seem to be stable once the program launches.

from PS

mysql 8877 0.0 30.0 1254936 473268 pts/0 Sl 10:35 0:05 /usr/sbin/mysqld --ba

VSZ  
1254936KB

RSS  
473268KB 450MB

I’ve optimized all my settings and there shouldn’t be a problem: from MySQLTuner:

Maximum possible memory usage: 338.9M (22% of installed RAM)  
Highest usage of available connections: 0% (1/151)  
Key buffer size / total MyISAM indexes: 8.0M/45.0K  
Query cache efficiency: 0.0% (0 cached / 26 selects)  
Query cache prunes per day: 0  
Sorts requiring temporary tables: 0% (0 temp sorts / 1 sorts)  
Temporary tables created on disk: 10% (10 on disk / 97 total)  
Thread cache hit rate: 94% (1 created / 18 connections)  
Table cache hit rate: 62% (111 open / 178 opened)  
Open file limit used: 0% (48/470K)  
Table locks acquired immediately: 100% (70 immediate / 70 locks)  
InnoDB data size / buffer pool: 864.0K/128.0M

using pmap i see there are a bunch of 10MB blocks of memory allocated, which makes sense, however, I see 2 huge chunks of memory allocated for reasons unknown, which I think are the problem, I cut out some of the early address because i hit the posting character limit:

[url][http://pastebin.com/1TeQVZxE[/url]](http://pastebin.com/1TeQVZxE%5B/url%5D)

it’s just anon memory allocation, which I don’t understand why it needs to allocate so much. Seems like a bug, any help would be GREATLY appreciated, I would like to get my server down to 200-300MB again.

---

<div class="post-metadata">

**Author:** ![rogers](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@rogers](https://forums.percona.com/u/rogers)\
**Post date:** [November 5, 2013, 5:07am UTC](https://forums.percona.com/t/percona-5-6-14-56-very-high-memory-usage/3030/2 "2013-11-05T05:07:02Z")

</div>

Hello,  
I can confirm this problem - update from MySQL 5.5 to Percona 5.6.14-60 on Debian Wheezy.

mysqltuner:  
[–] Up for: 21h 59m 32s (1M q [15.143 qps], 161K conn, TX: 1B, RX: 213M)  
[–] Reads / Writes: 69% / 31%  
[–] Total buffers: 309.0M global + 1.1M per thread (32 max threads)  
[OK] Maximum possible memory usage: 343.0M (22% of installed RAM)  
[!!] Highest connection usage: 90% (29/32)  
[OK] Key buffer size / total MyISAM indexes: 80.0M/384.9M  
[OK] Key buffer hit rate: 99.4% (53M cached / 330K reads)  
[!!] Query cache efficiency: 0.0% (0 cached / 596K selects)  
[OK] Query cache prunes per day: 0  
[OK] Sorts requiring temporary tables: 0% (127 temp sorts / 107K sorts)  
[!!] Joins performed without indexes: 1238  
[OK] Temporary tables created on disk: 10% (12K on disk / 123K total)  
[OK] Thread cache hit rate: 99% (114 created / 161K connections)  
[OK] Table cache hit rate: 33% (509 open / 1K opened)  
[OK] Open file limit used: 7% (389/5K)  
[OK] InnoDB data size / buffer pool: 186.6M/196.0M

top:  
USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND  
mysql 20 0 1233m 729m 7876 S 1.7 47.5 63:11.59 /usr/sbin/mysqld

pmap output:  
[url][http://pastebin.com/1mjRwvAv[/url]](http://pastebin.com/1mjRwvAv%5B/url%5D)

---

<div class="post-metadata">

**Author:** ![drinkedin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/drinkedin/32/969_2.png) [@drinkedin](https://forums.percona.com/u/drinkedin)\
**Post date:** [November 6, 2013, 10:06am UTC](https://forums.percona.com/t/percona-5-6-14-56-very-high-memory-usage/3030/3 "2013-11-06T10:06:10Z")

</div>

I can also confirm this problem. I went to a fresh 5.6 install (not an upgrade) and imported the data that was dumped from mysql. Percona is performing well, but memory consumption increases (slowly) monotonically and doesn’t come back down. This is independent of actual load.

---

<div class="post-metadata">

**Author:** ![rogers](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@rogers](https://forums.percona.com/u/rogers)\
**Post date:** [November 7, 2013, 8:40am UTC](https://forums.percona.com/t/percona-5-6-14-56-very-high-memory-usage/3030/4 "2013-11-07T08:40:45Z")

</div>

Dear Percona,  
I believe that this is a major issue with your product and it should be addressed quickly.  
Could you inform us about the progress of analyzing/fixing of this bug?  
I could add, that in my case it was Debian wheezy x64 on OpenVZ VPS server (kernel 2.6).

---

<div class="post-metadata">

**Author:** ![dan2600](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dan2600/32/965_2.png) [@dan2600](https://forums.percona.com/u/dan2600)\
**Post date:** [November 7, 2013, 1:48pm UTC](https://forums.percona.com/t/percona-5-6-14-56-very-high-memory-usage/3030/5 "2013-11-07T13:48:54Z")

</div>

Just checking in on this. Wanted to add I’m using  
Based on the number of views this thread has (more than any other post), I’m thinking a lot more people are having this problem.

There is absolutely nothing we can do right now to alleviate this issue, the users are helpless, please update us.

---

<div class="post-metadata">

**Author:** ![wemakecustom](https://avatars.discourse-cdn.com/v4/letter/w/e95f7d/32.png) [@wemakecustom](https://forums.percona.com/u/wemakecustom)\
**Post date:** [November 11, 2013, 9:13pm UTC](https://forums.percona.com/t/percona-5-6-14-56-very-high-memory-usage/3030/6 "2013-11-11T21:13:25Z")

</div>

I have the same issue, MySQL’s memory usage almost doubled. If I can’t fix this, I will have to go back to MySQL 5.5

This is completely unacceptable.

---

<div class="post-metadata">

**Author:** ![wemakecustom](https://avatars.discourse-cdn.com/v4/letter/w/e95f7d/32.png) [@wemakecustom](https://forums.percona.com/u/wemakecustom)\
**Post date:** [November 11, 2013, 10:46pm UTC](https://forums.percona.com/t/percona-5-6-14-56-very-high-memory-usage/3030/7 "2013-11-11T22:46:59Z")

</div>

For me, it seems to be very related to table\_open\_cache:

table\_open\_cache=32K: 1560M  
table\_open\_cache=64K: 2600M  
table\_open\_cache=128K: 3900M

other settings:  
max\_connections = 100  
join\_buffer\_size = 6M  
innodb\_buffer\_pool\_size = 1G  
query\_cache\_size = 300M

Data in MyISAM tables: 3K (Tables: 12)  
Data in InnoDB tables: 863M (Tables: 996)

---

<div class="post-metadata">

**Author:** ![s0enke](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@s0enke](https://forums.percona.com/u/s0enke)\
**Post date:** [November 14, 2013, 9:05am UTC](https://forums.percona.com/t/percona-5-6-14-56-very-high-memory-usage/3030/8 "2013-11-14T09:05:31Z")

</div>

Hi, we noticed higher VSZ memory usage as well. We could fix it by turning the performance\_schema=off. It was disabled by default in 5.5 and has been enabled by default since 5.6.6 (see [URL][http://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-6.html[/URL]](http://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-6.html%5B/URL%5D)).

---

<div class="post-metadata">

**Author:** ![dan2600](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dan2600/32/965_2.png) [@dan2600](https://forums.percona.com/u/dan2600)\
**Post date:** [November 15, 2013, 11:31am UTC](https://forums.percona.com/t/percona-5-6-14-56-very-high-memory-usage/3030/9 "2013-11-15T11:31:16Z")

</div>

thank you S0enke!!! adding performance\_schema = off

to my config also greatly reduced memory usage for me as well.

---

<div class="post-metadata">

**Author:** ![rogers](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@rogers](https://forums.percona.com/u/rogers)\
**Post date:** [November 15, 2013, 6:15pm UTC](https://forums.percona.com/t/percona-5-6-14-56-very-high-memory-usage/3030/10 "2013-11-15T18:15:11Z")

</div>

Disabling performance\_schema did the trick.  
Thank you!

---

<div class="post-metadata">

**Author:** ![przemek](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/przemek/32/3_2.png) [@przemek](https://forums.percona.com/u/przemek)\
**Post date:** [December 20, 2013, 7:16am UTC](https://forums.percona.com/t/percona-5-6-14-56-very-high-memory-usage/3030/11 "2013-12-20T07:16:55Z")

</div>

Regarding high memory usage in version 5.6, related to performance\_schema, there is a bug report :  
[url][MySQL Bugs: #68514: 5.6 huge memory usage with max\_connections parameter](http://bugs.mysql.com/bug.php?id=68514%5B/url%5D)  
Unfortunately, it wasn’t accepted as valid bug, see all the discussion in comments though.

Rogers,  
“I believe that this is a major issue with your product and it should be addressed quickly.”  
Performance schema is a functionality coming from upstream MySQL developed by Oracle crew, we just use exactly the same functionality in Percona Server.  
Do you notice smaller memory footprint in MySQL 5.6 vs PS 5.6? If yes, let us know.

Btw here you can find quick feature comparison between upstream and Percona versions:  
[url][Percona Server for MySQL 8.0 - Documentation — Percona Server 8.0 Documentation](http://www.percona.com/doc/percona-server/5.6/feature_comparison.html%5B/url%5D)

---

<div class="post-metadata">

**Author:** ![ethaniel](https://avatars.discourse-cdn.com/v4/letter/e/ba8739/32.png) [@ethaniel](https://forums.percona.com/u/ethaniel)\
**Post date:** [February 15, 2016, 8:40pm UTC](https://forums.percona.com/t/percona-5-6-14-56-very-high-memory-usage/3030/12 "2016-02-15T20:40:25Z")

</div>

What helped me was on CentOS was changing the memory allocator:

```auto

yum install jemalloc-devel

```

and add to my.cnf:

```auto

[mysqld_safe]
malloc-lib = /usr/lib64/libjemalloc.so.1

```
