Bug #58405 WB modeller leaks GDI objects like a sieve
Submitted: 22 Nov 2010 21:53 Modified: 14 Jan 2014 17:29
Reporter: Peter Laursen (Basic Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S2 (Serious)
Version:5.2.30 OS:Windows
Assigned to: Mike Lischke CPU Architecture:Any
Tags: qc

[22 Nov 2010 21:53] Peter Laursen
Description:
This is the latest of a lot of similar reports:
http://bugs.mysql.com/bug.php?id=58403

I think the problem is GDI (graphics Device Interface) objects not properly closed.  On Windows a program can have no more than 10,000 open GDI objects.  When it reaches 10,000 the program may crash, become irresponsible or expose painting failures. It is actually very unpredictable.

How to repeat:
Open modeller page. 
Create new model.
Add diagram.
Add some tables (or whatever objects) to diagram
Close diagram
Close model (no need to save)
..
Repeat over and over again and sooner or later WB will crash, become irresponsible or expose painting failures.

Additionally have Task Manager open (with the option to display open GDI objects) and see the no. of open GDI objects increase for every cycle.

Suggested fix:
Close objects in code properly so that GDI objects are not left behind.
[22 Nov 2010 21:54] Peter Laursen
Sigh! why can't I post a report here without having to correct a typo in synopsis! I did it again!
[23 Nov 2010 9:22] Valeriy Kravchuk
Indeed, when I tried to create models with 2 tables and 1:n relation and then close them without saving, I've got increase in number of GDI objects used, like this: 115 -> 275 -> 331 -> 381 -> ... This will lead to problems eventually.

Verified on 32-bit Windows XP.
[14 Jan 2014 17:29] Philip Olson
Fixed as of the upcoming MySQL Workbench 6.1.1 release, and here is the changelog entry:

On Microsoft Windows, opening and closing models/diagrams would increase
the number of open GDI (Graphics Device Interface) objects as they were
kept in memory for the undo queue. The required memory for this task was
decreased.

Thank you for the bug report.