Re: shared memory after server kill - Mailing list pgsql-novice

From Tom Lane
Subject Re: shared memory after server kill
Date
Msg-id 18019.1091715425@sss.pgh.pa.us
Whole thread Raw
In response to Re: shared memory after server kill  (Oliver Fromme <olli@lurza.secnetix.de>)
List pgsql-novice
Oliver Fromme <olli@lurza.secnetix.de> writes:
> When you kill the postmaster process forcibly, it doesn't
> release the shared memory segments that it had allocated.

> Use the "ipcs" command to list all currently allocated
> shared memory segments, and use "ipcrm" to remove them.

For some benighted reason, OS X doesn't provide either of those commands
(last I looked anyway).  AFAIK the only way to get rid of an unreleased
shmem segment in OS X is to reboot; there is no manual access to the
shared memory status.

Combine this problem with the fact that OS X's default limit on shmem
size is very small (not enough to allow two reasonable-sized shmem
segments), and you end up with the conclusion that kill -9'ing the
postmaster is an even worse idea on OS X than it is on other systems.
Next time use "kill -QUIT" if you want an emergency postmaster shutdown.
Or try "pg_ctl stop -m fast".

(But I think the real beginner mistake was to try to solve a problem by
killing the postmaster, rather than whichever child process was wedged.
The postmaster process is almost never the direct source of a user-visible
problem.)

            regards, tom lane

pgsql-novice by date:

Previous
From: Oliver Fromme
Date:
Subject: Re: shared memory after server kill
Next
From: David Norris
Date:
Subject: Re: UNICODE and regex character classes