From owner-freebsd-emulation@FreeBSD.ORG Tue Oct 18 06:30:13 2005 Return-Path: X-Original-To: emulation@hub.freebsd.org Delivered-To: freebsd-emulation@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E433D16A41F for ; Tue, 18 Oct 2005 06:30:13 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A8B6943D46 for ; Tue, 18 Oct 2005 06:30:13 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j9I6UDma000708 for ; Tue, 18 Oct 2005 06:30:13 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j9I6UDg7000706; Tue, 18 Oct 2005 06:30:13 GMT (envelope-from gnats) Date: Tue, 18 Oct 2005 06:30:13 GMT Message-Id: <200510180630.j9I6UDg7000706@freefall.freebsd.org> To: emulation@FreeBSD.org From: Nate Eldredge Cc: Subject: Re: kern/22826: Memory limits have no effect in linux compatibility X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Nate Eldredge List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2005 06:30:14 -0000 The following reply was made to PR kern/22826; it has been noted by GNATS. From: Nate Eldredge To: bug-followup@FreeBSD.org, hanche@math.ntnu.no Cc: Subject: Re: kern/22826: Memory limits have no effect in linux compatibility Date: Mon, 17 Oct 2005 23:23:12 -0700 (PDT) The "bug" here is that mmap does not respect the datasize limit (ulimit -d). But this may actually be correct. mmap'ed space is in some sense not part of the "data segment"; at least, it is not necessarily contiguous with the main data segment. I tested Linux and Solaris, and neither one subjects mmap to the datasize limit. The Linux malloc is a little counter-intuitive in that it may use mmap to acquire its memory, thus placing it outside the data segment and beyond the purview of ulimit -d, but I'm not sure I would call this a bug. mmap is subject to the virtual memory limit (ulimit -v) on FreeBSD, as it is on Linux and Solaris as well. So this is probably the right limit to set if you want to restrict how much memory the process can use. Maintainers, consider closing this? -- Nate Eldredge nge@cs.hmc.edu