Date: Fri, 14 Sep 2012 09:06:46 +0200 From: =?ISO-8859-1?Q?Micka=EBl_Can=E9vet?= <canevet@embl.fr> To: Sriram Gorti <gsriram@gmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: Swapped memory limited to about 500MB for a process ? Message-ID: <1347606406.4141.105.camel@pc437.embl.fr> In-Reply-To: <CAF_V1q4u=UNdMmcfYicKg%2BzGxn006f2Z%2BvOsyVBXfGUxQL5xEQ@mail.gmail.com> 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> <CAF_V1q4u=UNdMmcfYicKg%2BzGxn006f2Z%2BvOsyVBXfGUxQL5xEQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--=-ZgaAn3IIchEv8zHo2BB/ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2012-09-14 at 08:36 +0530, Sriram Gorti wrote: > On Wed, Sep 12, 2012 at 7:33 PM, Micka=C3=ABl Can=C3=A9vet <canevet@embl.= fr> wrote: > > On Wed, 2012-09-12 at 10:03 -0400, Lowell Gilbert wrote: > >> Micka=C3=ABl Can=C3=A9vet <canevet@embl.fr> writes: > >> > >> > On Tue, 2012-09-11 at 13:05 -0400, Lowell Gilbert wrote: > >> >> Micka=C3=ABl Can=C3=A9vet <canevet@embl.fr> 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 o= nly > >> >> > about 500MB of my 4GB swap partition was used before crashing. I = was > >> >> > wondering why it didn't take the whole 4GB up to the crash of the= server > >> >> > 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 = then > >> >> > 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 virtua= l > >> memory. You would have to diagnose through crash dumps, but it could b= e > >> that some more specific resource was exhausted. Or perhaps the memory > >> leak left dangling references in a vnode. > >> >=20 > 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. >=20 > vmstat -z | egrep "LIMIT|SWAPMETA" >=20 > --- sriram >=20 >=20 > > > > OK, > > > > Thanks a lot for your explanations. > > > > Cheers, > > Micka=C3=ABl >=20 I have this: # vmstat -z | egrep "LIMIT|SWAPMETA" ITEM SIZE LIMIT USED FREE REQ FAIL SLEEP SWAPMETA: 288, 116519, 1610, 6437, 559839, 0, 0 If this number (116519) correspond to the number of memory pages and as I have 4k page size (pagesize command reports 4096), SWAPMETA is limited to 466076 kB which is pretty close to the "about" 500MB I can see on my monitoring graphs. If this is the explanation of what happens, how can I tune this ? Should I use larger pages (superpages seems to be enable by default on FreeBSD9-amd64) ? Is there a way to increase the limit of swapmeta ? Thanks, Micka=C3=ABl --=-ZgaAn3IIchEv8zHo2BB/ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEABECAAYFAlBS14YACgkQZjBmN5Hi/YbIDgCcCOZo31npzqFVD6TzWsVQn7QT qz4An0jrA+NXsNk6Yc/2xbydTWu1fQpn =HrfD -----END PGP SIGNATURE----- --=-ZgaAn3IIchEv8zHo2BB/--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1347606406.4141.105.camel>