all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: [h-e-w] Emacs Resource (GDI) Leak on Windows
@ 2006-02-03 15:51 Andrew Maguire
  2006-02-04 11:20 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrew Maguire @ 2006-02-03 15:51 UTC (permalink / raw)
  Cc: help-gnu-emacs

This GDI leakage is still an issue - Emacs 21.2/3

It appears to be directly related to the display of any modified fonts, 
italic, bold etc.

For examnple,

1. start up a completely plain Emacs --no-site-file.
2. Run Windows Task Manager and set it to display GDI object usage.
3. M-x list-faces-display
4. SCroll the buffer up and down a lot and GDI object count increases.
5. Make the *Faces* buffer editable and remove all lines whose font is
    not simply a modified foreground a background colour, i.e. italic
    bold, fixed-pitch, variable-pitch, mode-line and tool-bar.
6. Repeat scrolling up and down to force redisplay of the screen
    and not that although the GDI count may go up by 1 or 2 after you
    stop scrolling the extra GDI resource is released leaving with the
    same number as before.

The GDI usage is also directly related to the font used also.
By default Emacs, uses Courier New, Regular, 10pt.
If you remove all the modified fonts above except italic.
Then you will find that GDI objects will leak if Courier New is used
but NOT if Courier is used.
It appears to be related to the method Emacs uses to generate these 
modified forms of the main font.

Courier New apears to be a TrueType font but Courier is not - whether 
that has any difference I am not sure.

I hope these observations will be able to help find a fix for this 
problem. It is a particular pain for Modes using font-lock when 
font-lock is configured to use bold and italic fonts.

As has been mentioned before in this thread, the GDI object resource is 
a strictly limited resource on Windows and when Windows approaches that 
limit the display code Windows uses to update the screen goes haywire, 
often blatting screen data in the top left portion of the screen.

Andrew Maguire

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [h-e-w] Emacs Resource (GDI) Leak on Windows
  2006-02-03 15:51 [h-e-w] Emacs Resource (GDI) Leak on Windows Andrew Maguire
@ 2006-02-04 11:20 ` Eli Zaretskii
  2006-02-04 11:32 ` Eli Zaretskii
  2006-03-12 22:57 ` [h-e-w] " Jason Rumney
  2 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2006-02-04 11:20 UTC (permalink / raw)


> Date: Fri, 03 Feb 2006 15:51:06 +0000
> From: Andrew Maguire <andrew.maguire@ps.ge.com>
> Cc: help-gnu-emacs@gnu.org
> 
> This GDI leakage is still an issue - Emacs 21.2/3

This is not the appropriate place to report such problems.  I've
redirected the discussion to emacs-devel@gnu.org, the Emacs
development mailing list.  Please follow-up there.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Emacs Resource (GDI) Leak on Windows
  2006-02-03 15:51 [h-e-w] Emacs Resource (GDI) Leak on Windows Andrew Maguire
  2006-02-04 11:20 ` Eli Zaretskii
@ 2006-02-04 11:32 ` Eli Zaretskii
  2006-03-12 22:57 ` [h-e-w] " Jason Rumney
  2 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2006-02-04 11:32 UTC (permalink / raw)
  Cc: emacs-devel, jasonr

> Date: Fri, 03 Feb 2006 15:51:06 +0000
> From: Andrew Maguire <andrew.maguire@ps.ge.com>
> Cc: help-gnu-emacs@gnu.org
> 
> This GDI leakage is still an issue - Emacs 21.2/3
> 
> It appears to be directly related to the display of any modified fonts, 
> italic, bold etc.

I'm not sure I can reproduce the problem with the latest development
sources, since you didn't show any numbers in your recipe.  See below.

> For examnple,
> 
> 1. start up a completely plain Emacs --no-site-file.
> 2. Run Windows Task Manager and set it to display GDI object usage.

At this point, I have 105 GDI objects showing up in the Task Manager.
If I wait enough for the splash screen to go away, I have 108 objects.

> 3. M-x list-faces-display

As soon as I type "M-x", the number of GDI objects goes up to 118.
After typing "list-faces-display RET", the count goes up to 119.

> 4. SCroll the buffer up and down a lot and GDI object count increases.

It increases to 121 and stops there.

> 5. Make the *Faces* buffer editable and remove all lines whose font is
>     not simply a modified foreground a background colour, i.e. italic
>     bold, fixed-pitch, variable-pitch, mode-line and tool-bar.
> 6. Repeat scrolling up and down to force redisplay of the screen
>     and not that although the GDI count may go up by 1 or 2 after you
>     stop scrolling the extra GDI resource is released leaving with the
>     same number as before.

This doesn't change the count for me.  Does that mean that the problem
was solved, and there's no more leakage anymore?  I'm asking because
it's not clear to me where did you see the leakage--you seem to be
telling that whenever the fonts are not used, their GDI objects are
released, which to me seems to mean there's no leak.

Finally, please tell what version of Windows is that.

And thanks for your report.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [h-e-w] Emacs Resource (GDI) Leak on Windows
  2006-02-03 15:51 [h-e-w] Emacs Resource (GDI) Leak on Windows Andrew Maguire
  2006-02-04 11:20 ` Eli Zaretskii
  2006-02-04 11:32 ` Eli Zaretskii
@ 2006-03-12 22:57 ` Jason Rumney
  2 siblings, 0 replies; 4+ messages in thread
From: Jason Rumney @ 2006-03-12 22:57 UTC (permalink / raw)
  Cc: help-gnu-emacs

Andrew Maguire <andrew.maguire@ps.ge.com> writes:

> This GDI leakage is still an issue - Emacs 21.2/3
>
> It appears to be directly related to the display of any modified
> fonts, italic, bold etc.

Thank you for the complete test case. The problem does not seem to
appear in current CVS Emacs. The number of GDI objects does increase
when new fonts are loaded etc, but the increase is bounded, and does
not increase any further by scrolling backwards and forwards. I
haven't yet managed to get my count of GDI objects past 188, and that
is after changing the default font and rerunning list-faces-display a
few times.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-03-12 22:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-03 15:51 [h-e-w] Emacs Resource (GDI) Leak on Windows Andrew Maguire
2006-02-04 11:20 ` Eli Zaretskii
2006-02-04 11:32 ` Eli Zaretskii
2006-03-12 22:57 ` [h-e-w] " Jason Rumney

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.