Error resolution for MySQL out of memory (Needed 16777224 bytes) _mysql

Source: Internet
Author: User
Tags mysql client stmt
This is a mistake these days.
As to whether I changed these values is not the correct solution, it is not known. Stick it out first.
If after a while I still did not update, then the comrades will refer to it.
Error resolution for out of memory (Needed 16777224 bytes)
Read the brochure:
[Url]http://dev.mysql.com/doc/refman/5.1/en/memory-storage-engine.html[/url]
At first I changed the value of the query_cache_size.
I don't think so.
After
Increases the value of the Query_cache_limit.
and Max_heap_table_size.
and tmp_table_size values.
Because we use a lot of preprocessing statements in our stored procedures. And the result of the statement is very large.
At first my results:
Mysql> Show variables like ' max_heap_table_size ';
+---------------------------------+----------------------+
| variable_name | Value |
+---------------------------------+----------------------+
| Max_heap_table_size | 16777216 |
+---------------------------------+----------------------+

Mysql> Show variables like ' tmp_table_size ';
+---------------------------------+----------------------+
| variable_name | Value |
+---------------------------------+----------------------+
| Tmp_table_size | 16777216 |
+---------------------------------+----------------------+

I changed the my.cnf file.

Mysql> Show variables like ' max_heap_table_size ';
+---------------------------------+----------------------+
| variable_name | Value |
+---------------------------------+----------------------+
| Max_heap_table_size | 67108864 |
+---------------------------------+----------------------+

Mysql> Show variables like ' tmp_table_size ';
+---------------------------------+----------------------+
| variable_name | Value |
+---------------------------------+----------------------+
| Tmp_table_size | 67108864 |
+---------------------------------+----------------------+

By the way, take a look at the passage in this article:
Http://dev.mysql.com/tech-resources/articles/mysql-query-cache.html

Qcache_hits and Qcache_inserts shows the number of times a query is serviced from the cache and how many queries have bee n inserted into the cache. Low ratios of hits to inserts indicate little query reuse or a too-low setting of the Query_cache_limit, which serves to G Overn the RAM devoted to each individual query cache entry. Large query result sets'll require larger settings of this variable.

Add:
I saw this in the brochure today.

Http://dev.mysql.com/doc/refman/5.1/en/out-of-memory.html
If you issue a query using the "MySQL client program" and "receive an error like the" following one, it means that MySQL does Not have enough memory to store the entire query result:

So I've modified all my stored procedures.
Because the preprocessing statement inside does not clear zero.
After testing.
Like what:
It's used inside.
PREPARE S1 from @STMT;
...
Be sure to
SET @STMT = ';
Don't know if this is the root cause. I'll update it again.
Again, that would reduce this situation. But all the stored procedures were modified in the afternoon.
All normal connections are changed to left join. The related index is established through explain.
and changed the version to 5.0.45. As to whether or not there is an error. Continue to focus on ... There are no errors at the moment.

This problem seems to be officially settled by MySQL.
http://bugs.mysql.com/bug.php?id=31898
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.