MySQL Forums
Forum List  »  InnoDB

MySQL kills itself when cannot allocate X bytes
Posted by: Marcos Cuadrado
Date: September 18, 2009 01:43AM

Hi!

Why does MySQL kill itself when cannot allocate X bytes in a insertion sentence? I tried to insert a 250Mb longblob several times with the same result. I understand that there's no memory available (yes, I checked and released some memory so I could achieve the insertion), but I would expect an error message, not any suicidal behavior xD because my applications want to keep inserting and querying other small data. is it possible to change this behavior modifying any MySQL variable?
This is what appears in the error file:

*********************************************
090917 11:11:59 [Note] C:\Archivos de programa\MySQL\MySQL Server 5.1\bin\mysqld: ready for connections.
Version: '5.1.32-community' socket: '' port: 3306 MySQL Community Server (GPL)
090917 11:17:16 InnoDB: Error: cannot allocate 269866312 bytes of
InnoDB: memory with malloc! Total allocated memory
InnoDB: by InnoDB 650515652 bytes. Operating system errno: 8
InnoDB: Check if you should increase the swap file or
InnoDB: ulimits of your operating system.
InnoDB: On FreeBSD check you have compiled the OS with
InnoDB: a big enough maximum process size.
InnoDB: Note that in most 32-bit computers the process
InnoDB: memory space is limited to 2 GB or 4 GB.
InnoDB: We keep retrying the allocation for 60 seconds...
090917 11:18:16 InnoDB: We now intentionally generate a seg fault so that
InnoDB: on Linux we get a stack trace.
090917 11:18:16 - mysqld got exception 0xc0000005 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=16777216
read_buffer_size=65536
max_used_connections=4
max_threads=50
threads_connected=4
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 32699 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x2dd471d0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
006EB10B mysqld.exe!ut_malloc_low()[ut0mem.c:150]
006EB13E mysqld.exe!ut_malloc()[ut0mem.c:189]
006EBCBD mysqld.exe!mem_area_alloc()[mem0pool.c:355]
006B643D mysqld.exe!mem_heap_create_block()[mem0mem.c:362]
006B6614 mysqld.exe!mem_heap_add_block()[mem0mem.c:466]
006B6794 mysqld.exe!mem_heap_alloc()[mem0mem.ic:155]
0070491D mysqld.exe!row_upd_index_replace_new_col_vals_index_pos()[row0upd.c:918]
006D4E10 mysqld.exe!btr_cur_pessimistic_update()[btr0cur.c:1867]
00705022 mysqld.exe!row_upd_clust_rec()[row0upd.c:1584]
00705C34 mysqld.exe!row_upd_clust_step()[row0upd.c:1794]
00705D20 mysqld.exe!row_upd()[row0upd.c:1871]
00705E59 mysqld.exe!row_upd_step()[row0upd.c:2000]
006B2342 mysqld.exe!row_update_for_mysql()[row0mysql.c:1411]
006A6C84 mysqld.exe!ha_innobase::update_row()[ha_innodb.cc:4007]
005B4417 mysqld.exe!mysql_update()[sql_update.cc:583]
00554527 mysqld.exe!mysql_execute_command()[sql_parse.cc:2981]
0054EEF9 mysqld.exe!check_stack_overrun()[sql_parse.cc:5468]
00528519 mysqld.exe!open_table()[sql_base.cc:3001]
006952B9 mysqld.exe!vio_write()[viosocket.c:121]
004D11BE mysqld.exe!net_real_write()[net_serv.cc:616]
006A9316 mysqld.exe!ha_innobase::reset()[ha_innodb.cc:6661]
0052299A mysqld.exe!close_thread_table()[sql_base.cc:1404]
0052424F mysqld.exe!close_open_tables()[sql_base.cc:1195]
004ACF66 mysqld.exe!general_log_write()[log.cc:4147]
7C929DAA ntdll.dll!RtlReAllocateHeap()
008CD324 mysqld.exe!thread_cache()
0040D76A mysqld.exe!()
28ADE900
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 2DD51838=UPDATE `Extraccion` SET `dat` = ? WHERE (`Id` = 3)
thd->thread_id=11
thd->killed=NOT_KILLED

*********************************************
I checked the equation:

key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads

and it is OK.

Besides, I see that the insertion of a blob of X bytes requires about 4*X free bytes in memory, is it possible to reduce that modifying any MySQL variable?

Thanks a lot!
Marcos.

Options: ReplyQuote


Subject
Views
Written By
Posted
MySQL kills itself when cannot allocate X bytes
4716
September 18, 2009 01:43AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.