Bug #34513 increasing memory consumption with creating/dropping tmp tables on debug binary
Submitted: 13 Feb 2008 7:32 Modified: 18 Feb 2008 21:59
Reporter: Shane Bester
Status: Verified
Category:Server: General Severity:S3 (Non-critical)
Version:5.1.23-debug OS:Microsoft Windows
Assigned to: Target Version:
Tags: memory leak
Triage: Triaged: D3 (Medium)

[13 Feb 2008 7:32] Shane Bester
Description:
memory appears to increase slowly (few kilobytes every minute) for debug binary when
creating and dropping many temporary tables.  the testcase uses a stored procedure to
loop n times. 

the allocations appear to be here:

8 bytes at 0x0034ba428, allocated at line  130 in '.\handler.cc'
8 bytes at 0x0034ba2d8, allocated at line  169 in '.\handler.cc'

How to repeat:
#note - you might want to change nice for mysqld before running this!!

delimiter //
drop procedure if exists `p`//
create procedure `p`(`n` int)
begin
declare `i` int default 0;
repeat
create temporary table `t`(`a` int)engine=myisam;
drop temporary table `t`;
set i:=i+1;
if i mod 1000=0 then select i;
end if;
until i>n end repeat;

end//

call `p`(1000000000)//
[18 Feb 2008 21:59] Miguel Solorzano
Thank you for the bug report.