Bug #11609 InnoDB: out of memory error
Submitted: 28 Jun 2005 12:13 Modified: 29 Jun 2005 7:06
Reporter: Rajesh Pulikonda Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:4.1.11-standard OS:Linux (Red Hat Linux 9.0)
Assigned to: CPU Architecture:Any

[28 Jun 2005 12:13] Rajesh Pulikonda
Description:
050402 04:02:19  mysqld restarted
050402  4:02:20 [Warning] Asked for 196608 thread stack, but got 126976
050402  4:02:21  InnoDB: Fatal error: cannot allocate 8404992 bytes of
InnoDB: memory with malloc! Total allocated memory
InnoDB: by InnoDB 4878496 bytes. Operating system errno: 12
InnoDB: Cannot continue operation!
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: Fatal error: cannot allocate the memory for the buffer pool
050402  4:02:21 [ERROR] Can't init databases
050402  4:02:21 [ERROR] Aborting

050402  4:02:22 [Note] /usr/sbin/mysqld: Shutdown complete

050402 04:02:23  mysqld ended

050404 12:31:51  mysqld started
050404 12:31:52 [Warning] Asked for 196608 thread stack, but got 126976
050404 12:31:52  InnoDB: Fatal error: cannot allocate 8404992 bytes of
InnoDB: memory with malloc! Total allocated memory
InnoDB: by InnoDB 4878496 bytes. Operating system errno: 12
InnoDB: Cannot continue operation!
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: Fatal error: cannot allocate the memory for the buffer pool
050404 12:31:52 [ERROR] Can't init databases
050404 12:31:53 [ERROR] Aborting

050404 12:31:53 [Note] /usr/sbin/mysqld: Shutdown complete

050404 12:31:53  mysqld ended

050404 12:32:12  mysqld started
050404 12:32:12 [Warning] Asked for 196608 thread stack, but got 126976
050404 12:32:12  InnoDB: Fatal error: cannot allocate 8404992 bytes of
InnoDB: memory with malloc! Total allocated memory
InnoDB: by InnoDB 4878496 bytes. Operating system errno: 12
InnoDB: Cannot continue operation!
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: Fatal error: cannot allocate the memory for the buffer pool
050404 12:32:12 [ERROR] Can't init databases
050404 12:32:12 [ERROR] Aborting

050404 12:32:12 [Note] /usr/sbin/mysqld: Shutdown complete

050404 12:32:12  mysqld ended

How to repeat:
050402 04:02:19  mysqld restarted
050402  4:02:20 [Warning] Asked for 196608 thread stack, but got 126976
050402  4:02:21  InnoDB: Fatal error: cannot allocate 8404992 bytes of
InnoDB: memory with malloc! Total allocated memory
InnoDB: by InnoDB 4878496 bytes. Operating system errno: 12
InnoDB: Cannot continue operation!
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: Fatal error: cannot allocate the memory for the buffer pool
050402  4:02:21 [ERROR] Can't init databases
050402  4:02:21 [ERROR] Aborting

050402  4:02:22 [Note] /usr/sbin/mysqld: Shutdown complete

050402 04:02:23  mysqld ended

050404 12:31:51  mysqld started
050404 12:31:52 [Warning] Asked for 196608 thread stack, but got 126976
050404 12:31:52  InnoDB: Fatal error: cannot allocate 8404992 bytes of
InnoDB: memory with malloc! Total allocated memory
InnoDB: by InnoDB 4878496 bytes. Operating system errno: 12
InnoDB: Cannot continue operation!
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: Fatal error: cannot allocate the memory for the buffer pool
050404 12:31:52 [ERROR] Can't init databases
050404 12:31:53 [ERROR] Aborting

050404 12:31:53 [Note] /usr/sbin/mysqld: Shutdown complete

050404 12:31:53  mysqld ended

050404 12:32:12  mysqld started
050404 12:32:12 [Warning] Asked for 196608 thread stack, but got 126976
050404 12:32:12  InnoDB: Fatal error: cannot allocate 8404992 bytes of
InnoDB: memory with malloc! Total allocated memory
InnoDB: by InnoDB 4878496 bytes. Operating system errno: 12
InnoDB: Cannot continue operation!
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: Fatal error: cannot allocate the memory for the buffer pool
050404 12:32:12 [ERROR] Can't init databases
050404 12:32:12 [ERROR] Aborting

050404 12:32:12 [Note] /usr/sbin/mysqld: Shutdown complete

050404 12:32:12  mysqld ended
[28 Jun 2005 12:26] Marko Mäkelä
Errno 12 is ENOMEM (out of memory). This is a completely normal InnoDB behavior. In a transactional RDBMS, an intentional crash is an acceptable way to recover from fatal error situations.

If you believe that MySQL/InnoDB is using more memory than it should or it leaks memory, please provide a repeatable test case.
[29 Jun 2005 7:06] Heikki Tuuri
Marko,

note that in this case InnoDB does not crash mysqld. It just returns that it cannot init itself, and mysqld shuts down.

The user should probably make key_cache and other MyISAM buffers smaller.

Regards,

Heikki
[6 May 2008 17:55] dan radom
Why would safe_mysqld attempt to start the DB when it is still running?