kern/22826: Memory limits have no effect in linux compatibility

Nate Eldredge nge at cs.hmc.edu
Mon Oct 17 23:30:14 PDT 2005


The following reply was made to PR kern/22826; it has been noted by GNATS.

From: Nate Eldredge <nge at cs.hmc.edu>
To: bug-followup at FreeBSD.org, hanche at 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 at cs.hmc.edu


More information about the freebsd-emulation mailing list