Re: [HACKERS] PostgreSQL and Windows2000 and defunct processes

From: "SHELTON,MICHAEL (Non-HP-Boise,ex1)" <michael_shelton(at)non(dot)hp(dot)com>
To: "'svajdic(at)asc(dot)corp(dot)mot(dot)com'" <svajdic(at)asc(dot)corp(dot)mot(dot)com>, pgsql-general(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org, steven_vajdic(at)yahoo(dot)com(dot)au
Subject: Re: [HACKERS] PostgreSQL and Windows2000 and defunct processes
Date: 2002-06-06 15:26:23
Message-ID: 14562BDD08E0FC4C93D7C92B249AC94D19F49D@xboi21.boise.itc.hp.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Steven,

I found the following snippet in MSDN under CreateProcess:

"The created process remains in the system until all threads within the
process have terminated and all handles to the process and any of its
threads have been closed through calls to CloseHandle. The handles for both
the process and the main thread must be closed through calls to CloseHandle.
If these handles are not needed, it is best to close them immediately after
the process is created."

If this is your case, what is unknown is why it is "not" happening in
win98?? Can you run a test and close the PROCESS_INFORMATION HANDLEs for
the main thread and the process itself and see if that makes a difference
(and any other HANDLEs that you might have gotten through OpenProcess()
calls...)?

Mike Shelton

-----Original Message-----
From: Steven Vajdic [mailto:svajdic(at)asc(dot)corp(dot)mot(dot)com]
Sent: Thursday, June 06, 2002 12:53 AM
To: pgsql-general(at)postgresql(dot)org; pgsql-hackers(at)postgresql(dot)org;
svajdic(at)asc(dot)corp(dot)mot(dot)com; steven_vajdic(at)yahoo(dot)com(dot)au
Subject: [HACKERS] PostgreSQL and Windows2000 and defunct processes

Problem:

Win2000 and Cygwin/postgresql-7.1 produce
"defunct" processes after each run which can ONLY be killed
by Win Task Manager. If you allow too many "defunct" processes
your database requests slow down and your number of connections
increases, i.e. if you
have 32 connections specified in your postgresql.conf file and
and 32 "defunct" processes and try to run again
the connection will be refused.
When you are killing "defunct" processes and reach the one which was
first formed
the postmaster restarts postgresql.

How to get read of those "defunct" processes?

Much obliged.

Steven.

P.S. You do not have these "defunct" processes under Win98!!!???

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Elphick 2002-06-06 16:14:05 Re: [GENERAL] performance issue using DBI
Previous Message Stephan Szabo 2002-06-06 15:05:46 Re: pg_shadow

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-06-06 16:13:50 Re: Straight-from-the-horses-mouth dept
Previous Message Bruce Momjian 2002-06-06 15:06:18 Re: Roadmap for a Win32 port