Bug #27593 On a crash, the memory statistics calculation differs from other documentation
Submitted: 2 Apr 2007 16:24 Modified: 5 Oct 2008 11:15
Reporter: Jeremy Jones Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: General Severity:S4 (Feature request)
Version:4.1.11 OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[2 Apr 2007 16:24] Jeremy Jones
Description:
When mysql crashes, it reports the potential memory usage of the mysql process into the error log. My server says:

----
key_buffer_size=536870912
read_buffer_size=1044480
max_used_connections=980
max_connections=1800
threads_connected=505
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 1852369 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
----

however according to the book High Performance MySQL (also on its URL http://dev.mysql.com/books/hpmysql-excerpts/ch06.html) the myisam_key_buffer_size should be included in that calculation:

----
min_memory_needed = global_buffers + (thread_buffers * max_connections)where thread_buffers includes the following:

sort_buffer
myisam_sort_buffer
...
----

And so I think there is an inconsistency in the documentation which is confusing. 

How to repeat:
I'm sorry but I do not know how to reliably crash the MySQL server in order to repeat this.

Suggested fix:
Revise one of these places (preferably the crash error reporting, if it's wrong) so that the two memory calculations are consistent.
[2 Apr 2007 17:36] Valeriy Kravchuk
Thank you for a reasonable feature request. Server still reports memory that might be used according to that formula you presented. While it does not include any InnoDB memory areas and some per thread buffers. It is really misleading to some users.
[5 Oct 2008 11:15] Konstantin Osipov
Duplicate of Bug#1694 Crash error message is misleading