From owner-freebsd-questions@FreeBSD.ORG Fri Sep 14 03:06:50 2012 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 11804106566C for ; Fri, 14 Sep 2012 03:06:50 +0000 (UTC) (envelope-from gsriram@gmail.com) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx1.freebsd.org (Postfix) with ESMTP id 8DADA8FC0A for ; Fri, 14 Sep 2012 03:06:49 +0000 (UTC) Received: by wibhr14 with SMTP id hr14so3432705wib.13 for ; Thu, 13 Sep 2012 20:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=eJPAjGlW9qWsY6ETBRNeFrMoE729FClHoCSzu4Dn+b0=; b=CSif06sNl4dD8ilfwznGas/3fhsinyrFTEOUDjnpprxyKR9NW0NSpiF8Ho3mBzrg2y UVRoMYZNaU4VbXqicPU0jB8+3j5yUKQJi1kRxQrqbi38Op/pAYHA2ddspu1WAq9Uj1tX 9W7urE2ml4dyFsgGIS63c+won+l2Rka0mpmdOD7dWFLap/1DHcJxr5GUb6IjeuA18o+S 0ZM/tnNbnRW5FxeIaWTEK2Gvll6OgATT7+lzdfDWnlsjhkS1Rw1Iop+tLTx81iJ7D+ON cuHe88Fx6sfEUVQVsYew3RTNIAp+K5rPiGifbRu1g27X9O3Zti01OyR9OWCSdgyqum+d kUhA== MIME-Version: 1.0 Received: by 10.216.143.158 with SMTP id l30mr672304wej.113.1347592008102; Thu, 13 Sep 2012 20:06:48 -0700 (PDT) Received: by 10.194.55.229 with HTTP; Thu, 13 Sep 2012 20:06:48 -0700 (PDT) In-Reply-To: <1347458607.4141.88.camel@pc437.embl.fr> References: <1347268974.4141.65.camel@pc437.embl.fr> <44k3w0ij6n.fsf@be-well.ilk.org> <1347432178.4141.82.camel@pc437.embl.fr> <44y5kfgwxi.fsf@be-well.ilk.org> <1347458607.4141.88.camel@pc437.embl.fr> Date: Fri, 14 Sep 2012 08:36:48 +0530 Message-ID: From: Sriram Gorti To: =?ISO-8859-1?Q?Micka=EBl_Can=E9vet?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org Subject: Re: Swapped memory limited to about 500MB for a process ? 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, 14 Sep 2012 03:06:50 -0000 On Wed, Sep 12, 2012 at 7:33 PM, Micka=EBl Can=E9vet wrot= e: > On Wed, 2012-09-12 at 10:03 -0400, Lowell Gilbert wrote: >> Micka=EBl Can=E9vet writes: >> >> > On Tue, 2012-09-11 at 13:05 -0400, Lowell Gilbert wrote: >> >> Micka=EBl Can=E9vet writes: >> >> >> >> > I was impacted by a memory leak that has been fixed by this patch: >> >> > http://people.freebsd.org/~rmacklem/namei-leak.patch >> >> > >> >> > What I noticed when the server was paging is that it seems that onl= y >> >> > about 500MB of my 4GB swap partition was used before crashing. I wa= s >> >> > wondering why it didn't take the whole 4GB up to the crash of the s= erver >> >> > because of lake of memory (that would let me more time to react). >> >> > >> >> > Is there such king of setting that prevent a process to put more th= en >> >> > 500MB of data in swap ? >> >> >> >> limits(1)? >> >> >> > Thank you for your answer. >> > >> > Here is the result of limits: >> > >> > limits >> > Resource limits (current): >> > cputime infinity secs >> > filesize infinity kB >> > datasize 33554432 kB >> > stacksize 524288 kB >> > coredumpsize infinity kB >> > memoryuse infinity kB >> > memorylocked infinity kB >> > maxprocesses 5547 >> > openfiles 11095 >> > sbsize infinity bytes >> > vmemoryuse infinity kB >> > pseudo-terminals infinity >> > swapuse infinity kB >> > >> > swapuse is set to unlimited, but stacksize is set to 512MB. >> > Is it the stacksize setting that prevent my kernel to swap more then >> > 512MB ? >> >> No, I don't think so. datasize was the parameter I was most >> suspecting; and it assumes that a particular process was causing the >> crash (which is unlikely; the OS is supposed to protect you against >> it). >> >> Most likely, the crash was not directly caused by a shortage of virtual >> memory. You would have to diagnose through crash dumps, but it could be >> that some more specific resource was exhausted. Or perhaps the memory >> leak left dangling references in a vnode. >> We also had a some what similar experience - swap partition was not being fully utilized (but no NFS in use). Found that the size of SWAPMETA limits the total usable swap space. This is more likely with a custom config and tweaked limits. vmstat -z | egrep "LIMIT|SWAPMETA" --- sriram > > OK, > > Thanks a lot for your explanations. > > Cheers, > Micka=EBl