Thread: possible GDI resource leak

possible GDI resource leak

From
"Merlin Moncure"
Date:
I'm running a recent snapshot and started noticing strange behavior on
the desktop.  Explorer was refusing to hide/show windows and
right-clicking on the application icon in the explorer bar refused to
show the system menu.  For those of you not in the know, this is the
classic sign that your system is out of handles (yes, this can even
happen on 2000/XP).

I began killing processes one by one to see who it was and everything
returned to normal after shutting down the server.  This could have been
a fluke, but be sure to mention it if you experience something similar.

Merlin

Re: possible GDI resource leak

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgsql-hackers-win32-owner@postgresql.org
> [mailto:pgsql-hackers-win32-owner@postgresql.org] On Behalf
> Of Merlin Moncure
> Sent: 22 June 2004 19:55
> To: pgsql-hackers-win32@postgresql.org
> Subject: [pgsql-hackers-win32] possible GDI resource leak
>
> I'm running a recent snapshot and started noticing strange
> behavior on the desktop.  Explorer was refusing to hide/show
> windows and right-clicking on the application icon in the
> explorer bar refused to show the system menu.  For those of
> you not in the know, this is the classic sign that your
> system is out of handles (yes, this can even happen on 2000/XP).
>
> I began killing processes one by one to see who it was and
> everything returned to normal after shutting down the server.
>  This could have been a fluke, but be sure to mention it if
> you experience something similar.

Hi Merlin,

I have seen similar symptoms myself recently, however I have been
running PostgreSQL quite rarely - mainly I've been compiling it and the
installer. I'm beginning to think it's the msys console, as a) that
seems to be the common thing running when this happens, and b)
occasionally when I shutdown I get a message saying rxvt couldn't be
terminated.

Regards, Dave

Re: possible GDI resource leak

From
"Merlin Moncure"
Date:
Dave Page wrote:
> > -----Original Message-----
> > From: pgsql-hackers-win32-owner@postgresql.org
> > [mailto:pgsql-hackers-win32-owner@postgresql.org] On Behalf
> > Of Merlin Moncure
> > Sent: 22 June 2004 19:55
> > To: pgsql-hackers-win32@postgresql.org
> > Subject: [pgsql-hackers-win32] possible GDI resource leak
> >
> > I'm running a recent snapshot and started noticing strange
> > behavior on the desktop.  Explorer was refusing to hide/show
> > windows and right-clicking on the application icon in the
> > explorer bar refused to show the system menu.  For those of
> > you not in the know, this is the classic sign that your
> > system is out of handles (yes, this can even happen on 2000/XP).
> >
> > I began killing processes one by one to see who it was and
> > everything returned to normal after shutting down the server.
> >  This could have been a fluke, but be sure to mention it if
> > you experience something similar.
>
> Hi Merlin,
>
> I have seen similar symptoms myself recently, however I have been
> running PostgreSQL quite rarely - mainly I've been compiling it and
the
> installer. I'm beginning to think it's the msys console, as a) that
> seems to be the common thing running when this happens, and b)
> occasionally when I shutdown I get a message saying rxvt couldn't be
> terminated.
>
> Regards, Dave

Possibly, I should have been paying more attention.  My particular
server has been up for several days.  I'll redirect stdout and see if
that makes a difference.

Merlin

Re: possible GDI resource leak

From
"Gary Doades"
Date:
On 22 Jun 2004 at 14:55, Merlin Moncure wrote:

> I'm running a recent snapshot and started noticing strange behavior on
> the desktop.  Explorer was refusing to hide/show windows and
> right-clicking on the application icon in the explorer bar refused to
> show the system menu.  For those of you not in the know, this is the
> classic sign that your system is out of handles (yes, this can even
> happen on 2000/XP).
>
> I began killing processes one by one to see who it was and everything
> returned to normal after shutting down the server.  This could have been
> a fluke, but be sure to mention it if you experience something similar.
>
> Merlin

Why would postgres use GDI at all (apart from maybe a hidden console
window and system menu)? Using Task Mangler I can see that each
postgres instance uses 4 GDI objects. So unless you have a hell of a
lot of connections to the database I can't see it using up a lot of GDI
objects. OTOH each postgres instance uses 140 (ish) handles. So after
a while handles may get a little clogged up if you have loads of
connections.

Have you used Task Mangler to look at handles, GDI object etc?

Regards,
Gary.


Re: possible GDI resource leak

From
Andrew Dunstan
Date:
Gary Doades wrote:

>Why would postgres use GDI at all (apart from maybe a hidden console
>window and system menu)? Using Task Mangler I can see that each
>postgres instance uses 4 GDI objects. So unless you have a hell of a
>lot of connections to the database I can't see it using up a lot of GDI
>objects. OTOH each postgres instance uses 140 (ish) handles. So after
>a while handles may get a little clogged up if you have loads of
>connections.
>
>Have you used Task Mangler to look at handles, GDI object etc?
>
>
>

You are referring to Task Manager, right?

cheers

andrew

Re: possible GDI resource leak

From
"Gary Doades"
Date:
On 22 Jun 2004 at 15:37, Andrew Dunstan wrote:

>
> You are referring to Task Manager, right?
>
> cheers
>
> andrew

Oh sorry, yes, just force of habit and many years or writing "Mangler".

Gary.


Re: possible GDI resource leak

From
"Magnus Hagander"
Date:
> > I'm running a recent snapshot and started noticing strange
> behavior on
> > the desktop.  Explorer was refusing to hide/show windows and
> > right-clicking on the application icon in the explorer bar
> refused to
> > show the system menu.  For those of you not in the know,
> this is the
> > classic sign that your system is out of handles (yes, this can even
> > happen on 2000/XP).
> >
> > I began killing processes one by one to see who it was and
> everything
> > returned to normal after shutting down the server.  This could have
> > been a fluke, but be sure to mention it if you experience
> something similar.
> >
> > Merlin
>
> Why would postgres use GDI at all (apart from maybe a hidden
> console window and system menu)? Using Task Mangler I can see
> that each postgres instance uses 4 GDI objects. So unless you
> have a hell of a lot of connections to the database I can't
> see it using up a lot of GDI objects. OTOH each postgres
> instance uses 140 (ish) handles. So after a while handles may
> get a little clogged up if you have loads of connections.

Run postgresql for a while and it will use a lot more than 140 handles
(if you have a large database). IIRC, postgresql will set the limit at
1024 open files / process. With 100 backends, you're up to 100k
handles...

But yeah, pg should not use any GDI objects. And I've also noticed the
problem with the mingw console not closing correctly etc, so it could
very well come from there.

Another option is that it's the total handle pool that's dying. If it
happens again, plz check out what kind of handles you're high on (you
can use performance monitor to get it more granular, IIRC).

//Magnus