MySQL 1163: Client out of memory.

  1. Increase the `readbuffersize` and `readrndbuffer_size` in your MySQL configuration temporarily to see if it alleviates the issue. Adjust these values in your `my.cnf` (Linux) or `my.ini` (Windows) file:


[mysqld]
read
buffersize = 2M
read
rndbuffer_size = 2M
After editing, restart the MySQL service.

  1. Optimize your query to use less memory by reducing the amount of data being processed at one time. For instance, if you’re joining large tables, see if you can filter rows earlier in your query or break your query into smaller parts.



  1. Check the memory usage of your system to ensure MySQL is not running out of memory due to other applications consuming it. Use the `free -m` command (Linux) or open Task Manager (Windows) to view memory usage.



  1. Investigate and set the `tmptablesize` and `maxheaptable_size` if your operations are creating large temporary tables. Increase these values in your `my.cnf`/`my.ini`:


[mysqld]
tmp
tablesize = 256M
max
heaptable_size = 256M
Restart the MySQL service after changes.

  1. Examine your queries for memory leaks especially if using stored procedures or functions. Run `SHOW PROCESSLIST;` to see running queries and `EXPLAIN` your query to understand how MySQL executes it.



  1. Check and clean up your MySQL error log. Sometimes, the log file itself can consume a lot of disk space which might indirectly affect the database performance. Use `SHOW VARIABLES LIKE 'log_error';` to find the log file location, then check its size and manually clear or compress if needed.



7. Increase your server's physical memory (RAM) if possible. This is a more drastic measure if the above adjustments do not help and if you consistently reach the memory limits.

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