From owner-freebsd-questions Wed May 13 13:08:53 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA05682 for freebsd-questions-outgoing; Wed, 13 May 1998 13:08:53 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from seabass.progroup.com (catfish.progroup.com [206.24.122.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA05676 for ; Wed, 13 May 1998 13:08:45 -0700 (PDT) (envelope-from craig@tuna.progroup.com) Received: from ProGroup.COM (tuna.progroup.com [206.24.122.5]) by seabass.progroup.com (8.7.5/8.7.3) with SMTP id NAA02855 for ; Wed, 13 May 1998 13:04:43 -0700 (PDT) Received: by ProGroup.COM (SMI-8.6/SMI-SVR4) id NAA15933; Wed, 13 May 1998 13:05:52 -0700 From: craig@tuna.progroup.com (Craig W. Shaver) Message-Id: <199805132005.NAA15933@ProGroup.COM> Subject: leaking shm segments (fwd) To: questions@FreeBSD.ORG Date: Wed, 13 May 1998 13:05:52 -0700 (PDT) X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Content-Length: 568 > > If a process creates a shared memory segment using shmget() and exits > without > deleting it via shmctl(), the segment does not get deleted. Since this > is a limited > resource in the kernel, the system will run out of shm segments. > > It was not clear to me from the man pages whether this is the expected > behavior > or whether this is a kernel bug (i.e. shm segments should be deleted > when the > creating process exits). > > Any suggestions? This is the expected behavior. Rewrite the process to check on the same token/key value for existing shm segments when opening/creating the shm. (Do not set the create flag and check the error return and the errno value.) Or, figure out what key value you are using with the segment in question and use ipcrm in a shell script to delete it when you start the process......... > > thanks, > - Jaspal > -- Craig Shaver (craig@progroup.com) (415)390-0654 Productivity Group POB 60458 Sunnyvale, CA 94088 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message