Bug #37637 crash in low memory situation (due to stored procedure cache becoming huge)
Submitted: 25 Jun 2008 18:57
Reporter: Shane Bester
Status: Analyzing
Category:Server: General Severity:S1 (Critical)
Version:5.1.26 OS:Any
Assigned to: Shane Bester Target Version:

[25 Jun 2008 18: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 18:59] Shane Bester
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.