Bug #40813 mysqld memory grows without bound with multiple large SELECTs in single session
Submitted: 18 Nov 2008 9:08 Modified: 28 Feb 2009 21:14
Reporter: Bond Masuda Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:6.3.17 OS:Linux (CentOS 5.2)
Assigned to: CPU Architecture:Any
Tags: large SELECT, Memory, mysqld

[18 Nov 2008 9:08] Bond Masuda
Description:
When executing SELECT queries on large tables in NDBENGINE, the mysqld process memory footprint grows without bounds. Repeated SELECT queries will continue to make the memory footprint increase until out of memory and mysqld crashes.

The only way to get mysqld to release the memory is to disconnect and reconnect. But within the same session, subsequent queries continue to make the mysqld process memory footprint increase.

How to repeat:
1. create any NDBENGINE table and populate with 1 million rows
2. monitor mysqld process memory with 'top'
3. within the same session/connection, run queries like:

SELECT * FROM table LIMIT 10000 OFFSET 0
SELECT * FROM table LIMIT 10000 OFFSET 10000
SELECT * FROM Table LIMIT 10000 OFFSET 20000
.
.
SELECT * FROM table LIMIT 10000 OFFSET Nx10000  (where N=0,..,100)

With each subsequent query, mysqld process consumes more and more memory.

Suggested fix:
I don't know what's wrong within MySQL Cluster. I've re-written my application code to disconnect and reconnect between large queries, this allows mysqld to recover and release the memory it allocated.
[18 Nov 2008 9:11] Bond Masuda
correct severity setting to S2.
[28 Jan 2009 21:14] Hartmut Holzgraefe
I can't reproduce this ...

Could you provide the CREATE statement for the table you're experience this with?
[1 Mar 2009 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".