Mysql Out of memory (Needed 16777224 bytes) Error resolution

Source: Internet
Author: User

This error occurs in the past few days.
I still don't know if these values are correct solutions. Post it first.
If I haven't updated it for a while, please refer to it later.
Out of memory (Needed 16777224 bytes) Error resolution
Look at the manual:
[Url] http://dev.mysql.com/doc/refman/5.1/en/memory-storage-engine.html#/url]
At first, I changed the value of query_cache_size.
It doesn't seem to work either.
After
Increase the value of query_cache_limit.
And max_heap_table_size.
And tmp_table_size.
Because many pre-processing statements are used in our stored procedures. And the statement results are very large.
My results at first:
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 modified 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, let's take a look at a 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 was serviced from the cache and how to specify queries have been 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 govern the RAM role Ted to each individual query cache entry. large query result sets will require larger settings of this variable.

Supplement:
I can see this in the manual 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 modified all my stored procedures.
The pre-processing statement is not cleared.
Tested.
For example:
Used in
PREPARE S1 FROM @ STMT;
...
Be sure
SET @ STMT = '';
I don't know if this is the root cause. I will update it again.
Once again, this will reduce this situation. However, all stored procedures were modified in the afternoon.
All common connections are changed to left join. Related indexes are created through EXPLAIN.
In addition, the version is changed to 5.0.45. Whether or not an error occurs. Still paying attention... There are currently no errors.

This problem seems to have been officially solved by MYSQL.
Http://bugs.mysql.com/bug.php? Id = 31898

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.