mysql Out of memory (Needed 16777224 bytes)的錯(cuò)誤解決
更新時(shí)間:2012年07月25日 00:46:41 作者:
至于我改的這幾個(gè)值是不是正確的解決方法,目前還不知道。先貼出來(lái)
這幾天碰到這個(gè)錯(cuò)誤。
至于我改的這幾個(gè)值是不是正確的解決方法,目前還不知道。先貼出來(lái)。
如果過(guò)一段時(shí)間我還是沒(méi)有更新,那以后同志們都參考吧 。
Out of memory (Needed 16777224 bytes)的錯(cuò)誤解決
看看手冊(cè):
[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的值。
因?yàn)槲覀兊拇鎯?chǔ)過(guò)程中用了好多的預(yù)處理語(yǔ)句。而且語(yǔ)句的結(jié)果都是非常大的。
起初我的結(jié)果:
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.
補(bǔ)充:
今天在手冊(cè)上看到這段話
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:
所以我把我的所有存儲(chǔ)過(guò)程都修改了。
因?yàn)槔锩娴念A(yù)處理語(yǔ)句沒(méi)有清零。
經(jīng)過(guò)測(cè)試。
比如:
里面用到
PREPARE S1 FROM @STMT;
...
一定要
SET @STMT = '';
不知道這個(gè)是不是根本原因。我會(huì)再次更新的。
再次證明這樣做會(huì)減少這種情況。不過(guò)下午把所有存儲(chǔ)過(guò)程修改了。
凡是普通連接的都改為L(zhǎng)EFT JOIN 了。通過(guò)EXPLAIN建立了相關(guān)索引。
而且把版本換成了5.0.45。至于是否還是出現(xiàn)錯(cuò)誤。還在繼續(xù)關(guān)注中。。。目前沒(méi)有任何錯(cuò)誤。
這個(gè)問(wèn)題貌似MYSQL官方解決了。
http://bugs.mysql.com/bug.php?id=31898
至于我改的這幾個(gè)值是不是正確的解決方法,目前還不知道。先貼出來(lái)。
如果過(guò)一段時(shí)間我還是沒(méi)有更新,那以后同志們都參考吧 。
Out of memory (Needed 16777224 bytes)的錯(cuò)誤解決
看看手冊(cè):
[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的值。
因?yàn)槲覀兊拇鎯?chǔ)過(guò)程中用了好多的預(yù)處理語(yǔ)句。而且語(yǔ)句的結(jié)果都是非常大的。
起初我的結(jié)果:
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.
補(bǔ)充:
今天在手冊(cè)上看到這段話
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:
所以我把我的所有存儲(chǔ)過(guò)程都修改了。
因?yàn)槔锩娴念A(yù)處理語(yǔ)句沒(méi)有清零。
經(jīng)過(guò)測(cè)試。
比如:
里面用到
PREPARE S1 FROM @STMT;
...
一定要
SET @STMT = '';
不知道這個(gè)是不是根本原因。我會(huì)再次更新的。
再次證明這樣做會(huì)減少這種情況。不過(guò)下午把所有存儲(chǔ)過(guò)程修改了。
凡是普通連接的都改為L(zhǎng)EFT JOIN 了。通過(guò)EXPLAIN建立了相關(guān)索引。
而且把版本換成了5.0.45。至于是否還是出現(xiàn)錯(cuò)誤。還在繼續(xù)關(guān)注中。。。目前沒(méi)有任何錯(cuò)誤。
這個(gè)問(wèn)題貌似MYSQL官方解決了。
http://bugs.mysql.com/bug.php?id=31898
您可能感興趣的文章:
- SQL Server出現(xiàn)System.OutOfMemoryException異常的解決方法
- MySQL Memory 存儲(chǔ)引擎淺析
- mysqld-nt: Out of memory (Needed 1677720 bytes)解決方法
- SqlServer如何通過(guò)SQL語(yǔ)句獲取處理器(CPU)、內(nèi)存(Memory)、磁盤(Disk)以及操作系統(tǒng)相關(guān)信息
- mysql Sort aborted: Out of sort memory, consider increasing server sort buffer size的解決方法
- SQL Server誤設(shè)置max server memory的處理方法
相關(guān)文章
在SQL中修改數(shù)據(jù)的基礎(chǔ)語(yǔ)句
修改數(shù)據(jù)SQL中,可以使用UPDATE語(yǔ)句來(lái)修改、更新一個(gè)或多個(gè)表的數(shù)據(jù),下面這篇文章主要給大家介紹了關(guān)于在SQL中修改數(shù)據(jù)的基礎(chǔ)語(yǔ)句,文中通過(guò)實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下2023-02-02Mysql 自定義隨機(jī)字符串的實(shí)現(xiàn)方法
前段時(shí)間接了一個(gè)項(xiàng)目,需要用到隨機(jī)字符串,但是mysql的庫(kù)函數(shù)沒(méi)有直接提供,需要我們自己實(shí)現(xiàn)此功能,下面小編給大家介紹下Mysql 自定義隨機(jī)字符串的實(shí)現(xiàn)方法,需要的朋友參考下吧2016-08-08MySQL安裝三種方法總結(jié)(yum安裝、編譯安裝、二進(jìn)制安裝)
MySQL安裝網(wǎng)上的教程有很多,基本上大同小異,但是安裝軟件有時(shí)就可能因?yàn)橐粋€(gè)細(xì)節(jié)安裝失敗,這篇文章主要介紹了MySQL安裝三種方法的相關(guān)資料,三種方法分別是yum安裝、編譯安裝以及二進(jìn)制安裝,需要的朋友可以參考下2023-12-12CentOS 7 下使用yum安裝MySQL5.7.20 最簡(jiǎn)單方法
這篇文章主要介紹了CentOS 7 下使用yum安裝MySQL5.7.20 最簡(jiǎn)單 方法,需要的朋友可以參考下2018-11-11