Mysql,innodb_buffer_pool_size Memory allocation

Source: Internet
Author: User

For MySQL. innodb_buffer_pool_size=8g. MySQL will take up 8G of memory (think top can see the memory is used 8G), but recently only carefully studied. This is not the case (it may be that the memory allocation to Linux malloc just knows a fur bar). When MySQL starts, it actually allocates the address space in virtual memory and does not actually map to physical memory.

Because malloc allocates memory first in virtual memory, it is actually mapped to physical memory when used

So this place. Assume that the machine memory is not being used properly. When MySQL really wants to map the physical memory. Assume that the physical memory is low. will go wrong or even quit.


But there is also a very strange place here is the Oom Killer under Linux:

If I have a program A has been executed, and allocated 22G of memory (machine configuration is physical memory 16g+swap 8G), but there is no real mapping to physical memory;

At this time MySQL boot, innodb_buffer_pool_size=8g, boot normal.

Then program a starts to actually allocate physical memory. Only 2G of swap memory is left.

At this point, MySQL also started the actual use of memory, because there is only 2G SWAP, so the performance is very poor. Again more than 2G, memory exhaustion, then oom killer start kill process, how to kill, who occupy memory more kill who, so will process a killed, memory suddenly back, MySQL will not quit;

However, the general system of MySQL is the largest allocation of memory, so often the MySQL was killed.


Linux Oom Killer can be seen: Understanding and configuring Linux in the following Oom Killer

Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.

Mysql,innodb_buffer_pool_size Memory allocation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.