[Note] InnoDB memory allocation and innodb Memory Allocation

Source: Internet
Author: User

[Note] InnoDB memory allocation and innodb Memory Allocation

Original article: http://www.mysqlperformanceblog.com/2006/05/30/innodb-memory-usage/

There are many problems related to how InnoDB allocates memory. Here I try to explain the memory allocation at startup. First, list important constants:

NBLOCKS = number of innoDB buffer pool blocks = innodb_buffer_pool_size/16384

OS _THREADS = if (innodb_buffer_pool_size> = 1000 Mb) = 50000

Else if (innodb_buffer_pool_size> = 8 Mb) = 10000

Else = 1000 (this is correct for Linux systems and another computing method for Windows)

Therefore, InnoDB memory usage:

L innodb buffer pool memory

L innodb extra memory pool size

L innodb record buffer size

L adaptive hash index, size = innodb buffer pool/64

L system directory hash, size = 6 * innodb buffer pool/512

L memory used by the synchronized array (sync_array), used by the synchronization unit, size = OS _THREADS * 152

L memory of system events (OS _events), also used by synchronization units, size = OS _THREADS * 216

L memory locked by the system, size = 5*4 * NBLOCKS

 

Therefore, the last innodb formula is as follows:

Buffer pool size + buffer record size + additional memory pool size + 812/16384 * buffer pool size + OS _THREADS * 368
For simplicity: 812/16384 * buffer pool size ~~ Buffer pool size/20

And OS _THREADS * 368 = 17.5 MB if the buffer pool size is greater than 1000 MB

= 3.5 MB if the buffer pool size is greater than 8 MB

For example, your buffer pool size is 1500 MB, the size of the additional memory pool is 20 MB, and the record buffer size is 8 Mb, the memory allocated by InnoDB is 1500 M + 20 M + 8 M + 1500/20 M + 17.5 M = 1620.5 M.

When you plan to use the memory of your server, you need to consider the use of additional memory.


How can I allocate memory after a notebook is inserted with a new memory?

The hard disk is the bookcase of your home, used to store books; the memory is the desk table of your home, used to do things, the desk is large, the bookcase remains unchanged. Do you understand that you have no friends?

In terms of terms, memory is a temporary storage. The hard disk is a permanent storage.
For reference.

How can I allocate dynamic memory to my laptop? Details

The system will automatically allocate the shared memory when it is not enough, but your video card must support dynamic memory.

Related Article

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.