Bug #37637 crash in low memory situation (due to stored procedure cache becoming huge)
Submitted: 25 Jun 2008 16:57 Modified: 29 Sep 2010 8:52
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: General Severity:S1 (Critical)
Version:5.1.26 OS:Any
Assigned to: CPU Architecture:Any

[25 Jun 2008 16:57] Shane Bester
Description:
forward:
it seems every client that calls stored procedures, views, triggers, functions adds to the memory requirement needed by the mysterious stored procedure cache.

this means on a 32-bit server, if you have 300 stored routines and there are 30 clients running concurrently calling them, significant (and unaccountable!) memory is consumed.

the bug:
this bug is about a crash that happens when the server starts running out of memory during calling many stored procedures.

another problem is the myisam corruption experienced shortly *before* the crash.
see uploaded a typical error log for this situation.  (i masked sensitive info)

How to repeat:
create many stored routines
call each one from many concurrent connections

(i'll upload a standalone testcase later)

Suggested fix:
periodically clear the stored routine cache to avoid over-consumption of memory,  by running this:

create view v1 as select now();
drop view v1;
[25 Jun 2008 16:59] MySQL Verification Team
error log showing corruption and crash, but server is minimally configured to use small footprint

Attachment: bug37637_error_log_masked.txt (text/plain), 5.79 KiB.

[29 Jun 2010 6:23] Matthew Harris
Experienced crash 2 times in the same session.  I aas unable to send a bug report as a result of the low memory so one could assume your stats will show less cases of this bug then may be actaully occuring.

Love the program!  I will be using it with many projects moving forward.

Matthew Harris