From owner-freebsd-questions@FreeBSD.ORG Fri Feb 26 07:19:56 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 ED8B4106564A for ; Fri, 26 Feb 2010 07:19:55 +0000 (UTC) (envelope-from penoff@gmail.com) Received: from mail-pz0-f184.google.com (mail-pz0-f184.google.com [209.85.222.184]) by mx1.freebsd.org (Postfix) with ESMTP id C5DE78FC0A for ; Fri, 26 Feb 2010 07:19:55 +0000 (UTC) Received: by pzk14 with SMTP id 14so2216644pzk.28 for ; Thu, 25 Feb 2010 23:19:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=cWUFZYd/g2hFFns9MqZXsFBNELFi9Rv59PhorWPftNE=; b=K57gj08zvUmblYBdV2siQIayrEnxA0pEdaCGa/nV9Fm7YURp4qaWTRXaXkuRtVpzLz yno6Wdi4uZiztvmasrFJMFIzPvELCL4M2bvmsxy7uEF/hdNy4WWx29ZJ75/Ko3PSUZBS g7JNLqXYjKBHrbFBPR/TupXD2SDi3usvbqXXQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=c+BCpoGyqmCRnMErKR9cLhBb3J+phGK5WCTesFGbgNa54GxzJI36K+XHIFjP0+Uxpw cpmWjiETfbXEeMb7CJiu62LpcX/WVcG4zxZHqDVkhdo9bkJMK9UdN8VghqhJs84/O2s+ hEHu9zewPmU1ULPH/5T1S1bIak3jW3Op70jHA= MIME-Version: 1.0 Sender: penoff@gmail.com Received: by 10.141.214.38 with SMTP id r38mr260064rvq.264.1267166962408; Thu, 25 Feb 2010 22:49:22 -0800 (PST) Date: Thu, 25 Feb 2010 22:49:22 -0800 X-Google-Sender-Auth: d784b93c1ffdf449 Message-ID: From: Brad Penoff To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: 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: Fri, 26 Feb 2010 07:19:56 -0000 Greetings, I have a 32-bit machine with 2 GB running FreeBSD 8. I have a complex application that starts getting ENOMEM once the resident memory is about 200 MB. I 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. Including swap space, I should be able to handle 3 GB in an application. I 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 ). This 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. I was hoping that some kind and helpful person could take a look at it and help me out. It 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). I 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). The goal is for "SIZE" to be 1.5 GB or higher; "RES" is up to the OS. For example, on Linux, "SIZE" (called "VIRT") goes as high as 2.8 GB before the system just becomes slow and unusable (never saw ENOMEM). For FreeBSD, what can I change to increase the possible "SIZE" before I see ENOMEM? I 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. Any ideas? Why is it not going beyond 200 MB? Resident 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. I 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). Anxious to hear what options exist. Thanks again, brad