Mysqld-nt: Out of memory (Needed 1677720 bytes) solution, mysqld-nt1677720
The website was found to be a little slow today and mysql Log prompts mysqld-nt: Out of memory (Needed 1677720 bytes). The Troubleshooting result was due to the recent adjustment of some mysql parameters, I think the memory is too large to be afraid. The 32-bit system really has a low content utilization rate. It is said that the memory usage is no more than 4 GB, and our 32 GB memory is really a waste, in the future, use win2008 r2 or centos as the server. I will share with you the solution below:
The configuration of different mysql versions may be slightly different, mainly because the following parameters are set:
Key_buffer, key_buffer_size, read_buffer_size, and sort_buffer_size. If you remember this parameter, modify it. After modification, it is generally reduced, and then the mysql service can be restarted.
Core tips: Check the mysqld configuration my. conf. Focus on the parameters key_buffer_size, max_heap_table_size, and tmp_table_size. We recommend that you set the key_buffer_size value to 1/4 of max_heap_table_size.
Because of the large surplus of server memory, I put my. several parameters in conf are quite large, 1G or even 2G, but not stable. mysqld reports several Out of memory (Needed xxx bytes) errors. when analyzing the causes, the 32-bit linux system does not support PAE and cannot use more than 3 GB of memory. Therefore, we need to change the parameters to a smaller value, the maximum error is several hundred MB, but several Out of memory Errors still occur. As a result, the online multi-party query was followed by the formula
Key_buffer_size + (read_buffer_size + sort_buffer_size) * max_connections
Inspired by the two checks on the parameters key_buffer_size, max_heap_table_size, and tmp_table_size, we found that the three values were set the same, and they all were 512 MB!
So we changed the key_buffer_size to 128 M, restarted the monitoring of mysqld for the next five hours, and no similar error occurred.
After changing these parameters, I still checked Out of memory and found innodb_buffer_pool_size = 1512 M. So I changed it to 1000 M and started Mysql again.
Note: This server has a total of 3 GB memory: The size is as large as below:
Key_buffer = 200 M
Key_buffer_size = 1294963200
# Max_join_size = 4294967295
Max_join_size = 1294967295
Max_allowed_packet = 1 M
# Table_open_cache = 512
Table_cache = 512
Sort_buffer_size = 2294967295
Read_buffer_size = 2147479552
# Write_buffer_size = 4294967295
Read_rnd_buffer_size = 4 M
Myisam_sort_buffer_size = 64 M
Thread_cache_size = 8
Query_cache_size = 16 M
Php error Fatal error: Out of memory (allocated 262144) (tried to allocate 19456 bytes
An error occurs after php runs for a while:
Php error Fatal error: Out of memory (allocated 262144) (tried to allocate 19456 bytes
It indicates a fatal error. If the memory is exceeded, allocated 262144 has been allocated and 19456 bytes are allocated.
The solution is to modify php. ini and increase memory_limit.
I was shocked. html can be accessed normally, but php cannot. I thought it was an attack.
Later, I saw that www.blogguy.cn could not access Fatal error: Out of memory (allocated 262144) (tried to allocate 19456 bytes. I knew it was caused by insufficient memory, but the vps could not be connected, I can't see who is occupying the memory. I can only go to the website background to restart the vps, and I don't know where the problem is. Record Filing!
Modification Method
Modify php. ini
The following Regions
Max_execution_time = 120; Maximum execution time of each script, in seconds
Max_input_time = 60; Maximum amount of time each script may spend parsing request data
Memory_limit = 64 M; Maximum amount of memory a script may consume (64 MB)
Adjust as needed.
Restart apache.