2g的mysql修复时间,[MySQL FAQ]系列 -- 64位系统下也报内存分配不能超过2G?

作/译者:叶金荣(Email:

c3f7cf7250583b5dab147ec66529b7bd.gif),来源:http://imysql.cn,转载请注明作/译者和出处,并且不能用于商业用途,违者必究。

明明是64位系统下,有16G内存,启动mysqld时指定 innodb_buffer_pool_size 为12G,却报一下错误:080829 14:15:14 mysqld started

InnoDB: HugeTLB: Warning: Failed to allocate 12884918272 bytes. errno 22

InnoDB HugeTLB: Warning: Using conventional memory pool

080829 14:15:14 InnoDB: Error: cannot allocate 12884918272 bytes of

InnoDB: memory with malloc! Total allocated memory

InnoDB: by InnoDB 44607312 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

Warning: Failed to allocate 29360128 bytes from HugeTLB memory. errno 12

Warning: Using conventional memory pool

080829 14:16:14 [Note] /usr/local/mysql/bin/mysqld: ready for connections.

Version: '5.0.45-log' socket: '/home/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)

是不是很奇怪呢?

根据错误提示的内容,google一下,发现是内核限制的缘故:[root@yejr mysql]# cat /proc/sys/vm/nr_hugepages

6000

修改一下内核限制:[root@yejr mysql]# echo 0 > /proc/sys/vm/nr_hugepages

然后重启mysql,一切正常了。

另外,还需要关注一下配置文件 /etc/security/limits.conf 里的内容。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值