diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc index e5fda378f15..f7959ea47f1 100644 --- a/sql/signal_handler.cc +++ b/sql/signal_handler.cc @@ -191,16 +191,18 @@ extern "C" sig_handler handle_fatal_signal(int sig) if (dflt_key_cache && thread_scheduler) { + size_t used_mem= + (dflt_key_cache->key_cache_mem_size + + (global_system_variables.read_buff_size + + (size_t) global_system_variables.sortbuff_size) * + (thread_scheduler->max_threads + extra_max_connections) + + (max_connections + extra_max_connections) * sizeof(THD)) / 1024; + my_safe_printf_stderr("It is possible that mysqld could use up to \n" "key_buffer_size + " "(read_buffer_size + sort_buffer_size)*max_threads = " - "%zu K bytes of memory\n", - (dflt_key_cache->key_cache_mem_size + - (global_system_variables.read_buff_size + - (size_t)global_system_variables.sortbuff_size) * - (thread_scheduler->max_threads + extra_max_connections) + - (max_connections + extra_max_connections) * - sizeof(THD)) / 1024); + "%zu K bytes of memory\n", used_mem); + my_safe_printf_stderr("%s", "Hope that's ok; if not, decrease some variables in " "the equation.\n\n");