Bug #62133 Workbench Devours All Available Memory on Mac OS X for Simple Query
Submitted: 10 Aug 2011 0:00 Modified: 10 Aug 2011 17:18
Reporter: Dan Hammari Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:5.2.34 OS:MacOS (10.6.8)
Assigned to: CPU Architecture:Any
Tags: mac, Memory, os x, workbench

[10 Aug 2011 0:00] Dan Hammari
Description:
This morning I rebuilt a large schema on a remote MySQL server using the "Execute SQL File" option in the "File" menu. I executed several files that averaged 150M of sql commands each (920M total). All seemed well at that point. Since then, subsequent queries have been less successful. Workbench locks up my machine's resources and returns only errors. I restarted my system several times and even reinstalled Workbench. The problem persists. While monitoring my system's resources in a Terminal window I noticed that every time I attempt to view a table's contents in Workbench all available memory is taken by that application. I use Workbench daily in my work and this is the first time I have seen this behavior. The remote MySQL systems seem fine when I access them through other SQL development tools. Only my local version of Workbench seems affected.

How to repeat:
1. Open Workbench and connect to a remote MySQL server
2. Execute several large sql files (5 files about 200M each) from the "Execute SQL File" option in the "File" menu
3. Restart Computer
4. Open Terminal window and execute the "top" command to view system processes
5. Open Workbench and connect to a remote MySQL server
6. Select a schema, expand the list of tables, right click on a table and select the "Select Rows - Limit 1000" option
7. Switch to the Terminal window and watch Workbench consume all available memory and slow your system to a crawl
8. After about fifteen minutes (if Workbench doesn't crash) you may see an error message in the Response field in the Workbench Output tab
9. Quit Workbench to free up your system's memory

Suggested fix:
This issue seems to be related to the several large sql files I executed earlier in the day. Some configuration setting must linger in my user settings because reinstalling the application has not affected its behavior.
[10 Aug 2011 0:39] Dan Hammari
Here is the content of the output tab after the Workbench query fails: 

Time: 17:26:34
Error: std::bad_alloc

Local Computer Specs:
MacBook Pro
Processor: 2.33 GHz Intel Core 2 Duo 
Memory: 3 GB 667 MHz DDR2 SDRAM
Mac OS X Vesrion 10.6.8
[10 Aug 2011 17:16] Dan Hammari
Well, the problem seems to have fixed itself, whatever the issue was. I came into work today, started up Workbench anew, and my connections are all working properly now. Whatever weirdness that went on yesterday had disappeared. You can probably mark this issue as closed and just keep it in your archives as reference if anyone else reports something similar in the future.

-Dan
[10 Aug 2011 17:18] Dan Hammari
Marking bug report as closed as issue has disappeared.