Mysql必读mysql Out of memory (Needed 16777224 bytes)的错误解决

Mysql必读mysql Out of memory (Needed 16777224 bytes)的错误解决,第1张

概述介绍《Mysql必读mysql Out of memory (Needed 16777224 bytes)的错误解决》开发教程,希望对您有用。

《MysqL必读MysqL Out of memory (Needed 16777224 bytes)的错误解决》要点:
本文介绍了MysqL必读MysqL Out of memory (Needed 16777224 bytes)的错误解决,希望对您有用。如果有疑问,可以联系我们。

这几天碰到这个错误.
至于我改的这几个值是不是正确的解决方法,目前还不知道.先贴出来.
如果过一段时间我还是没有更新,那以后同志们都参考吧 .
Out of memory (Needed 16777224 bytes)的错误解决
看看手册:
[url]http://dev.MysqL.com/doc/refman/5.1/en/memory-storage-engine.HTML[/url]
开始我更改了query_cache_size的值.
好像也不行.
之后
增大query_cache_limit 的值.
还有max_heap_table_size
和tmp_table_size的值.
因为我们的存储过程中用了好多的预处理语句.而且语句的结果都是非常大的.
起初我的结果:
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 |
+---------------------------------+----------------------+

我改了my.cnf文件

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 |
+---------------------------------+----------------------+

顺便看一下这篇文章中的一段话:
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 many 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 deVoted to each indivIDual query cache entry. Large query result sets will require larger settings of this variable.

补充:
今天在手册上看到这段话

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:

所以我把我的所有存储过程都修改了.
因为里面的预处理语句没有清零.
经过测试.
比如:
里面用到
PREPARE S1 FROM @STMT;
...
一定要
SET @STMT = '';
不知道这个是不是根本原因.我会再次更新的.
再次证明这样做会减少这种情况.不过下午把所有存储过程修改了.
凡是普通连接的都改为left JOIN 了.通过EXPLAIN建立了相关索引.
而且把版本换成了5.0.45.至于是否还是出现错误.还在继续关注中...目前没有任何错误.

这个问题貌似MysqL官方解决了.
http://BUGs.MysqL.com/BUG.PHP?ID=31898

欢迎参与《MysqL必读MysqL Out of memory (Needed 16777224 bytes)的错误解决》讨论,分享您的想法,内存溢出PHP学院为您提供专业教程。

总结

以上是内存溢出为你收集整理的Mysql必读mysql Out of memory (Needed 16777224 bytes)的错误解决全部内容,希望文章能够帮你解决Mysql必读mysql Out of memory (Needed 16777224 bytes)的错误解决所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/1153503.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-31
下一篇 2022-05-31

发表评论

登录后才能评论

评论列表(0条)

保存