[Padre-dev] Massive GDI object leakages

Adam Kennedy adamkennedybackup at gmail.com
Sun Dec 28 16:16:35 PST 2008

I've recently started noticing that if I try to use Padre for long
periods of time (one work day) on Windows it eventually stops
displaying icons and labels.

This is a typical symptom of GDI object exhaustion.

On Windows, all visible application elements interact with the
operating system via the Graphics Device Interface.


Every panel, icon, button, etc, needs to have a GDI object in order
for Windows to correctly render it to screen.

A typical number of GDI objects used by an application such as an
editor is a few hundred (Ultraedit uses 433, Notepad++ about 350,
Padre is around 250 at startop).

The problem is that Padre is leaking these GDI objects like you
wouldn't believe. For example, Padre is currently leaking one GDI
object per keystroke!

This quickly results in Padre blowing out to 5,000 or 10,000 GDI
objects, exhausting the stack and resulting in ugly degradation of the

On older (or all?) Windows (2k at least) this pool is also globally
shared, meaning that GDI exhaustion results in ALL applications on the
machine degrading.

To get some visibility of the GDI objects used by Padre, open the Task
Manager, select the menu View -> Select Columns... and then tick the
"GDI Objects" column.

Then just open an empty document and start typing...

Adam K

More information about the Padre-dev mailing list