From owner-freebsd-questions@FreeBSD.ORG Wed May 21 08:43:37 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2E46106567B for ; Wed, 21 May 2008 08:43:37 +0000 (UTC) (envelope-from penoff@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.238]) by mx1.freebsd.org (Postfix) with ESMTP id 6DB158FC13 for ; Wed, 21 May 2008 08:43:37 +0000 (UTC) (envelope-from penoff@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so2626605rvf.43 for ; Wed, 21 May 2008 01:43:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=o+Gn1QHl1MIJsyoXkdyauNc/kVb51hDmOLYeX8SGEro=; b=ZdsC4OP86PaoqPU8LwTWxeNYJnt5Z86ftoDpF6AWIW9Vd6Upmdun33ygbE7qtms/wOFp8x/oou48AZ974sVK1zdhzPByD4NQ2bXeauSIU9dc3OVIc3t3xbfd1eRMcK0ue/j0hLAgU2/ZAcpRygOYQRO/RAC/9rZyNjKvyoVfqUk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=GfCnDBb6AiHC4OSvNDxWic7BJAuOlSc7BgoOL2vTw0sWq2F93J2idhMg4uLCzwKOjHaUNAdKa5Xxgs55oNbsP95DUx/ePIoiord14cNFZhkrOV/8bZzM35KapY8Ak1FcEZs4Caz074YTD25+A5JgPc/kSBb+BcsxbXb2nUk4LQc= Received: by 10.140.177.15 with SMTP id z15mr4971165rve.70.1211359416969; Wed, 21 May 2008 01:43:36 -0700 (PDT) Received: by 10.140.135.16 with HTTP; Wed, 21 May 2008 01:43:36 -0700 (PDT) Message-ID: Date: Wed, 21 May 2008 01:43:36 -0700 From: "Brad Penoff" Sender: penoff@gmail.com To: freebsd-questions@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080520165437.36413c46.wmoran@potentialtech.com> X-Google-Sender-Auth: 3835a34569ac1a0d Subject: Re: resident memory limit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2008 08:43:37 -0000 On Tue, May 20, 2008 at 2:39 PM, Brad Penoff wrote: > On Tue, May 20, 2008 at 1:54 PM, Bill Moran wrote: >> In response to "Brad Penoff" : >>> >>> I have an application that runs on Linux or Mac OS X but seems to have >>> a problem when I run on FreeBSD (6.3 or 7). The issue is the memory >>> footprint for the application (osubw_sctpclien below) is quite large; >>> on Linux it can be as much as 950 MB in resident memory, according to >>> top. However, on FreeBSD I start to get ENOMEM always around the time >>> my resident memory size is about 200 MB. >>> >>> I read a few posts and have seen people fixing their problems by >>> adjusting kern.maxdsiz in /boot/loader.conf and/or by adding a swap >>> file. I've tried both and for my application, it still seems to be >>> limited to 200 MB resident memory regardless of maxdsize and swap file >>> setting. I wrote a toy application (malloctest below) that calls >>> malloc in a while(1) and breaks once it gets ENOMEM (doing another >>> while(1) so it doesn't exit); this application's memory size in top >>> always matches the kern.maxdsiz setting, however it has a very low >>> resident memory number, according to top. >> >> Have a look at /etc/login.conf and the associated man pages. >> BTW, we've seen the exact behavior on FreeBSD 7 as well (6.3 was reported here). We've tried on different hardware as well, and keep getting haunted by this resident memory limit that we don't know how to set. Any idea why, in the data I originally reported, I can allocate kern.maxdsiz + swap (see SIZE from top output) for malloc(1 MB) in a while loop, yet the top value for RES is always really low? How come, in contrast, my application starts to report ENOMEM when SIZE is 203 MB and RES is 201 MB? This is why I titled the thread asking about an unknown (to me ;-) limit for resident memory... Any other suggestions? brad > > Thanks for the prompt reply. > > This system has the default settings for all users set to "unlimited" > for more or less all login.conf categories. I've pasted them below. > My application uses a raw socket so I was running it as root, which > also uses the default settings. > > It mentioned that setting memoryuse is the same as setting both -cur > and -max ; any ideas why memoryuse is saying it's unlimited even > though it is not? I tried explicitly setting -cur to 1000M and it > still started giving ENOMEM around 200 MB resident memory in top... > > brad > > > default:\ > :passwd_format=md5:\ > :copyright=/etc/COPYRIGHT:\ > :welcome=/etc/motd:\ > :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES:\ > :path=/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin > /usr/local/bin /usr/X11R6/bin ~/bin:\ > :nologin=/var/run/nologin:\ > :cputime=unlimited:\ > :datasize=unlimited:\ > :stacksize=unlimited:\ > :memorylocked=unlimited:\ > :memoryuse=unlimited:\ > :filesize=unlimited:\ > :coredumpsize=unlimited:\ > :openfiles=unlimited:\ > :maxproc=unlimited:\ > :sbsize=unlimited:\ > :vmemoryuse=unlimited:\ > :priority=0:\ > :ignoretime@:\ > :umask=022: > > root:\ > :ignorenologin:\ > :tc=default: > > > >> -- >> Bill Moran >> http://www.potentialtech.com >> >> >