Bug #38834 key_buffer_size irregularities on 64 bit windows
Submitted: 16 Aug 2008 9:35 Modified: 2 Apr 2009 9:59
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S3 (Non-critical)
Version:mysql-5.1.26-rc-winx64 OS:Windows (64-bit)
Assigned to: Assigned Account CPU Architecture:Any
Tags: key_buffer_size

[16 Aug 2008 9:35] Shane Bester
Description:
5.0 docs say this:
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#option_mysqld_key_buff...

"The maximum allowable setting for key_buffer_size is 4GB on 32-bit platforms. As of MySQL 5.0.52, values larger than 4GB are allowed for 64-bit platforms (except 64-bit Windows, for which large values are truncated to 4GB with a warning)."

5.1 and 6.0 docs say this:
http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#option_mysqld_key_buff...

"The maximum allowable setting for key_buffer_size is 4GB on 32-bit platforms. As of MySQL 5.1.23, values larger than 4GB are allowed for 64-bit platforms."

5.1 and 6.0 say nothing about windows limitations.

However, there is a glaring problem in the handling of >4GB on 5.1.26-rc-x64:

This allocates 0 for key_buffer_size:
E:\mysql-5.1.26-rc-winx64\bin>mysqld --key_buffer_size=4096M --console --skip-grant-tables --skip-name-resolve

This allocates 4095M for key_buffer_size:
E:\mysql-5.1.26-rc-winx64\bin>mysqld --key_buffer_size=4095M --console --skip-grant-tables --skip-name-resolve

This allocates 1G for key_buffer_size
E:\mysql-5.1.26-rc-winx64\bin>mysqld --key_buffer_size=5G --console --skip-grant-tables --skip-name-resolve

How to repeat:
Try set a larger than 4G key_buffer_size on 64-bit windows builds.  Notice memory consumption in task manager.  Notice there are no warnings in the error log.

Suggested fix:
If the limit of 4G really applies to windows 64-bit builds:
1) add a warning during server startup.
2) document the limit.
3) remove the limit in future version since 64-bit windows is a major platform.
[18 Aug 2008 4:03] Valeriy Kravchuk
Thank you for a bug report. Verified just as described.
[29 Mar 2009 18:01] MySQL Verification Team
isn't this fixed already, since 5.1.31 ?
[29 Mar 2009 18:10] MySQL Verification Team
it was fixed in bug #39494 ?
[2 Apr 2009 9:59] Anurag Shekhar
duplicate of Bug#39494