From owner-freebsd-bugs@FreeBSD.ORG Sat Aug 7 16:20:03 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84ECC1065676 for ; Sat, 7 Aug 2010 16:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 58CEA8FC13 for ; Sat, 7 Aug 2010 16:20:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o77GK3ld047135 for ; Sat, 7 Aug 2010 16:20:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o77GK3cv047134; Sat, 7 Aug 2010 16:20:03 GMT (envelope-from gnats) Date: Sat, 7 Aug 2010 16:20:03 GMT Message-Id: <201008071620.o77GK3cv047134@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Vernon Schryver Cc: Subject: Re: kern/149323: [libc] Applications with large memory footprint failing with mmap(2) - memory allocation errors X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Vernon Schryver List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2010 16:20:03 -0000 The following reply was made to PR kern/149323; it has been noted by GNATS. From: Vernon Schryver To: bug-followup@FreeBSD.org Cc: rblayzor@inoc.net Subject: Re: kern/149323: [libc] Applications with large memory footprint failing with mmap(2) - memory allocation errors Date: Sat, 7 Aug 2010 16:17:14 GMT The problem does not happen with clean install of i386 Freebsd 8.1 and DCC 2.3.131 on a 32-bit box with 4 GByte of RAM less about 500 MByte of PCI window. The problem does happen after creating /boot/loader.conf.local containing kern.maxdsiz="2048M" and rebooting. It happens when the dccd process reaches about 880 MBytes of mmap()'ed windows into /var/dcc/dcc_db and /var/dcc/dcc_db.hash. `sysctl kern.maxdsiz` on my test system says "kern.maxdsiz: 536870912" without /boot/loader.conf.local but "kern.maxdsiz: 2147483648" with the file. The message try #1 mmap(dcc_db 0xeee000,0x3,0x801,11,0x49b72000): Cannot allocate memory means that mmap(0, 0xeee000,0x3,0x801,11,0x49b72000) returned ENOMEM where FD 11 is the file .../dcc_db The message "try #2 mmap(...) ok" means that mmap() worked after releasing some mmap()'ed memory. I don't remember whether setting kern.maxdsiz was once needed to run a DCC server on FreeBSD. As far as I know it is not needed now. Evidently something happened to the effects of kern.maxdsiz between FreeBSD 7.3 and 8.1 Perhaps the bug can be fixed by merely documenting the new effects of kern.maxdsiz Vernon Schryver vjs@rhyolite.com