MySQL 1164: Server out of memory.

  1. Check Current Memory Usage: Run `SHOW ENGINE INNODB STATUS;` to check the InnoDB memory allocation.



  1. Identify Large Queries: Execute `SHOW FULL PROCESSLIST;` to identify any long-running or large queries that might be consuming excessive memory.



  1. Optimize Problematic Queries: Use the information from the previous step to optimize or kill any problematic queries. To kill a query, use `KILL [query ID];`



  1. Clear Query Cache: If query cache is enabled, clear it by executing `FLUSH QUERY CACHE;`



  1. Check Table Locks: Run `SHOW OPEN TABLES WHERE In_use > 0;` to identify if there are any tables locked, consuming memory.



  1. Reduce Memory Usage: Temporarily reduce the `innodbbufferpoolsize` (if it's set very high) to free up some memory. Use `SET GLOBAL innodbbufferpoolsize = [desired size];` Make sure to adjust this to a safe value that won't impact your system's performance negatively.



  1. Restart MySQL Service: If possible and as a last resort, restart the MySQL service to clear the memory. Use your system's service management commands for this, such as `sudo systemctl restart mysql` on Linux.



8. Check Error Log: Finally, check the MySQL error log for any additional clues. The location of the log file varies but can often be found in `/var/log/mysql/error.log` or by running `SHOW VARIABLES LIKE 'log_error';`

Never debug

MySQL

manually again

Let Dr. Droid create custom investigation plans for your infrastructure.

Book Demo
Automate Debugging for
MySQL
See how Dr. Droid creates investigation plans for your infrastructure.

MORE ISSUES

Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid