From owner-freebsd-questions@FreeBSD.ORG Sat Feb 27 01:00:38 2010 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 61F07106564A for ; Sat, 27 Feb 2010 01:00:38 +0000 (UTC) (envelope-from penoff@gmail.com) Received: from mail-pz0-f181.google.com (mail-pz0-f181.google.com [209.85.222.181]) by mx1.freebsd.org (Postfix) with ESMTP id 2F4298FC08 for ; Sat, 27 Feb 2010 01:00:37 +0000 (UTC) Received: by pzk11 with SMTP id 11so517013pzk.9 for ; Fri, 26 Feb 2010 17:00:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=pQLF+cisW1/6eX9EhLcX0e0YLoxbAxGdzAePmgbFdV4=; b=vcTAW9hTBbPrG6avFf6ChEWgyGbd9w0W1eu154+lN8pQmfTUo3PIR8TwoDrt/JiIYo qqxDrV/X0gcPOwDTmqhcP1BSNC4ZaWDr/DrsFXCE3ub34y3cpy4V6hgrXy2shpeiOCtj 7McQjEHBL/SkRXyMKv/MarboZbuDKw5GHJA8A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=xyTNOUOSAyRnlLMCLwVrBRIwYOCNNFeq3xl81IJxmrl+3BOBNJ2jCsP7oi8d3DWs+8 xrbuITeO1d4plLnYLeODV09i8mfpSlj56QK7H61DbdCvY7brkevnKx0lSUzkdv/FYrl0 Kr+M9dtu8+TTX/gCxUktXmvGRA2Zh5rEW7Uek= MIME-Version: 1.0 Sender: penoff@gmail.com Received: by 10.141.91.20 with SMTP id t20mr654424rvl.19.1267232426528; Fri, 26 Feb 2010 17:00:26 -0800 (PST) In-Reply-To: References: Date: Fri, 26 Feb 2010 17:00:26 -0800 X-Google-Sender-Auth: b3fa6a85c92feff1 Message-ID: From: Brad Penoff To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Sat, 27 Feb 2010 02:36:09 +0000 Cc: Humaira Kamal , =?ISO-8859-1?Q?Irene_R=FCngeler?= , Michael Tuexen , Bill Moran , "Peter Lei \(peterlei\)" , Alan Wagner , Anton Yuzhaninov Subject: Re: premature ENOMEM 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: Sat, 27 Feb 2010 01:00:38 -0000 Solved!!! Peter Lei of Cisco noticed this application uses mmap rather than malloc so I could get what I wanted (go beyond 200 MB without ENOMEM) if I adjusted sysctl -w vm.max_proc_mmap to be a higher value. Thanks so much for everyone's help, brad On Fri, Feb 26, 2010 at 8:12 AM, Brad Penoff wrote: > Thanks Anton for the advice about a low kern.maxdsiz . =A0Does that work > on your machine? =A0I tried to give instructions in the original post so > that anyone can tune their machine and try to see what I am seeing. > Can others try to see on their own machines if the suggestions work? > I'll do anything to help (even provide machines, if need be). =A0I'm > surprised how difficult this is FreeBSD compared to Linux and Mac OS > X, but I think FreeBSD will be the most performant if I can get over > this hump. > > On my machine, I had kern.maxdsiz, kern.maxssiz, and kern.dfldsiz all > set to 2147483648 to match the 2 GB on my machine; that wasn't working > though. =A0I tried to modify but had much worse results... > > I set this: > kern.maxdsiz=3D"1000000" > kern.maxssiz=3D"2147483648" > kern.dfldsiz=3D"2147483648" > ... and NFS didn't load. > > I set this: > kern.maxdsiz=3D"0" > kern.maxssiz=3D"2147483648" > kern.dfldsiz=3D"2147483648" > ... and sshd didn't load! > > What combination should I try or what combination did you have in > mind? =A0Please excuse my ignorance. > > Also, I don't understand the link you sent... was it mistyped? =A0It > seems to go to some index and not any advice on this matter... > http://docs.freebsd.org/cgi/mid.cgi?200207291839.g6TIduVw055637 > > Thanks again for your help and ahead of time to anyone else's... I'm > getting a bit desperate and I'm surprised how difficult this is to get > working in FreeBSD when it was so simple in Linux and Mac OS X. =A0The > thing is, I typically use FreeBSD for the best performance but I can't > even get it to run there, at the moment. > > Thanks, > brad > > > On Thu, Feb 25, 2010 at 10:49 PM, Brad Penoff wrote: >> Greetings, >> >> I have a 32-bit machine with 2 GB running FreeBSD 8. =A0I have a complex >> application that starts getting ENOMEM once the resident memory is >> about 200 MB. =A0I adjusted the appropriate /boot/loader.conf and >> /etc/login.conf settings resulting in an increase in the "limit" >> values to around 2 GB, but still the complex application gives me >> ENOMEM at 200 MB. =A0Including swap space, I should be able to handle 3 >> GB in an application. =A0I need help understanding how I can enable this >> or why I cannot. >> >> I had this same problem on FreeBSD 6.3 about a year and a half ago, >> but I found an application-level work-around particular for FreeBSD >> (the full thread is here http://markmail.org/message/5nsld7pb25m5bfja >> ; but we found no general solution unfortunately ). =A0This >> application-level work-around is no longer sufficient so I wanted to >> revisit the root of this problem I was seeing and hopefully ask this >> community of smart hackers to give me a hand here... >> >> I have created a simplified application that demonstrates this exact >> same problem and made it easy to reproduce. =A0I was hoping that some >> kind and helpful person could take a look at it and help me out. =A0It >> doesn't require any editing of code or anything... In the end, I just >> need to know how to configure my FreeBSD box with 2 GB of RAM to not >> give me ENOMEM for this application when it is using only 200 MB, >> something that never happened in the previous unresolved thread >> reverenced above. >> >> This simplified application has a deliberate memory leak but the goal >> is for it to not give ENOMEM at 200 MB (I want to be able to use about >> 1.5 GB). =A0I have created a tarball... I think it may only work on a >> 32-bit machine. >> >> download/wget http://cs.ubc.ca/~penoff/reslim.tgz >> tar zxf reslim.tgz >> cd reslim >> gmake (or make on Linux) >> sh ./myumem.sh >> >> On my system, when this prints our an error message, in "top", I only >> see about 200 MB of both "SIZE" and "RES" (they are a few numbers >> off). =A0The goal is for "SIZE" to be 1.5 GB or higher; "RES" is up to >> the OS. =A0For example, on Linux, "SIZE" (called "VIRT") goes as high as >> 2.8 GB before the system just becomes slow and unusable (never saw >> ENOMEM). =A0For FreeBSD, what can I change to increase the possible >> "SIZE" before I see ENOMEM? =A0I have tried increasing >> /boot/loader.conf values to match my 2 GB RAM (kern.maxdsiz, >> kern.maxssiz, kern.dfldsiz), as well as unlimited values in >> /etc/login.conf, but still 200 MB seems a hard limit. =A0Any ideas? =A0W= hy >> is it not going beyond 200 MB? =A0Resident memory is equal to memory >> size used by the app so why is it never going to disk to swap before >> ENOMEM comes up? >> >> Thanks a million for any help or advice you could lend. =A0I would be >> more than willing to help in any way, even providing a machine to try >> this on (I could sponsor an emulab.net account). =A0Anxious to hear what >> options exist. >> >> Thanks again, >> brad >> >