Fatal error: cannot allocate the memory for the buffer pool

100602 14:23:17 mysqld started
100602 14:23:17 [Warning] The syntax for replication startup options is deprecated and will be removed in MySQL 5.2. Please use 'CHANGE MASTER' instead.
100602 14:23:17 InnoDB: Error: cannot allocate 10737434624 bytes of
InnoDB: memory with malloc! Total allocated memory
InnoDB: by InnoDB 39818848 bytes. Operating system errno: 12
InnoDB: Check if you should increase the swap file or
InnoDB: ulimits of your operating system.
InnoDB: On FreeBSD check you have compiled the OS with
InnoDB: a big enough maximum process size.
InnoDB: Note that in most 32-bit computers the process
InnoDB: memory space is limited to 2 GB or 4 GB.
InnoDB: We keep retrying the allocation for 60 seconds...
InnoDB: Fatal error: cannot allocate the memory for the buffer pool
100602 14:24:17 [ERROR] Default storage engine (InnoDB) is not available
100602 14:24:17 [ERROR] Aborting

100602 14:24:17 [Note] /usr/local/mysql50/libexec/mysqld: Shutdown complet

系统是64bit的:

Linux mapi109 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

机器内存12G:

[root@mapi109 mysql3601]#   cat /proc/meminfo | grep MemTotal
MemTotal:     12296092 kB

my.cnf里面设置也没有超过这个值:

innodb_buffer_pool_size = 5G设置的也小于系统内存。

网上很多人说,是因为内核限制的原因,看了一下自己的机器没有这个限制:

[root@mapi109 mysql3601]# cat /proc/sys/vm/nr_hugepages 
0

最后发现是因为机器上跑了另外一个端口,innodb_buffer_pool_size 开了15G。

原文地址:https://www.cnblogs.com/EasonSun/p/2938149.html