From owner-freebsd-questions Wed May 13 11:55:14 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA21460 for freebsd-questions-outgoing; Wed, 13 May 1998 11:55:14 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from castor.loco.net (lucy.bedford.net [206.99.145.54]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA21454 for ; Wed, 13 May 1998 11:55:04 -0700 (PDT) (envelope-from listread@bedford.net) Received: (from listread@localhost) by castor.loco.net (8.8.8/8.8.8) id OAA05851; Wed, 13 May 1998 14:54:42 -0400 (EDT) (envelope-from listread) Message-Id: <199805131854.OAA05851@castor.loco.net> Subject: Re: leaking shm segments In-Reply-To: <3559CC2E.2BAEE281@best.com> from Jaspal Kohli at "May 13, 98 09:37:03 am" To: jaspal@best.com (Jaspal Kohli) Date: Wed, 13 May 1998 14:54:41 -0400 (EDT) Cc: freebsd-questions@FreeBSD.ORG Reply-to: djv@bedford.net From: CyberPeasant X-Mailer: ELM [version 2.4ME+ PL38 (25)] 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 Jaspal Kohli wrote: > 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. Well, you can run out of inodes, too. > 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). > This is normal behavior. These segments are more like files than anything else -- global resources that may be accessed by any process on the system, subject to permissions. [An extension to the semantics on some OS's allows access from different machines over a network]. Unlike files, they only live from boot to boot. shmctl can be used to make them have the delete-when-unreferenced property, if that's what your app. needs, using IPC_RMID. Similar remarks apply to SysV semaphores and message queues. Dave -- <----. mail-to: djv@bedford.net <----|=================================== <----' Zber Qnrzbaf, Srjre Qrivyf! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message