Why is memory usage so high in MySQL?

Why is memory usage so high in MySQL?

I used mysqltuner to check the problem related to frequent crashes of my database. I received this warning *** MySQL’s maximum memory usage is dangerously high *** Here’s the result of mysqltuner:

What’s the maximum memory for MySQL in CentOS?

I ran the MySQLTuner script, and followed the recommendations that they gave, but it’s still recommending increases, while telling me that MySQL’s maximum memory usage is dangerously high. I have a CentOS 6.5 with 64 GB RAM.

What are the settings for max _ connections in MySQL?

The script basically multiplies max_connections with some settings. A thread needs to allocate some memory for itself (1 connection = 1 thread). Some settings that are used per thread: thread_stack, net_buffer_length,

Is there a limit to the number of caches in MySQL?

This should be readdressed if you significantly increase the dataset size. Increase ulimit -n in the OS; there appears to be a default limit of 1024 per process. This will allow several caches to be larger. table_open_cache was (I assume) autosized to be 407, but this seems to be too low.

How is memory reserved for use in MySQL?

MySQL uses memory in two ways: Memory permanently reserved for its use – This category of memory known as “ Global Buffers ” is obtained from the operating system during server boot-up and is not released to any other process.

What to do when MySQL runs out of memory?

Identify the crash by checking MySQL error log and Linux log file (i.e. /var/log/messages or /var/log/syslog). You may see an entry saying that OOM Killer killed MySQL. Whenever MySQL has been killed by OOM “dmesg” also shows details about the circumstances surrounding it.

How does memory allocation work in MySQL server?

For the Global variables like key_buffer_size, query_cache_size etc,  MySQL always allocates and initializes the specified amount of memory all at once when the server starts.