Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Apr 2011 14:24:07 -0700
From:      Artem Belevich <art@freebsd.org>
To:        Boris Kochergin <spawk@acm.poly.edu>
Cc:        Kostik Belousov <kostikbel@gmail.com>, FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>
Subject:   Re: Kernel memory leak in 8.2-PRERELEASE?
Message-ID:  <BANLkTiktQhwSUHWnMB8X3Yznce0_RM8nVg@mail.gmail.com>
In-Reply-To: <4D9A307F.9070408@acm.poly.edu>
References:  <4D972FF7.6010901@acm.poly.edu> <20110402153315.GP78089@deviant.kiev.zoral.com.ua> <4D974393.80606@acm.poly.edu> <4D9A307F.9070408@acm.poly.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Apr 4, 2011 at 1:56 PM, Boris Kochergin <spawk@acm.poly.edu> wrote:
> The problem persists, I'm afraid, and seems to have crept up a lot more
> quickly than before:
>
> # uname -a
> FreeBSD exodus.poly.edu 8.2-STABLE FreeBSD 8.2-STABLE #3: Sat Apr =A02
> 11:48:43 EDT 2011 =A0 =A0 spawk@exodus.poly.edu:/usr/obj/usr/src/sys/EXOD=
US
> =A0amd64
>
> Mem: 314M Active, 955M Inact, 6356M Wired, 267M Cache, 828M Buf, 18M Free
>
> Any ideas for a diagnostic recourse?

My bet would be that the wired memory is used by ZFS ARC. In your
vmstat-m output you can see that  ~2.2G were allocated for 'solaris'
subsystem. Due to the fact that ARC allocations tend to be random, we
do waste a lot of memory on that. There were few patches floating on
stable@ adn fs@ that were supposed to mitigate the issue, but so far
there's no good out of the box solution. General advice is to tune ARC
so that it works in your case. Key loader tunables are
vfs.zfs.arc_min and vfs.zfs.arc_max. Don't set min too high and
experimentally set max to the maximum value that does not cause
problems.

One of the factors that makes things noticeably worse is presence of
i/o actifity on non-ZFS filesystems. Regular filesystems cache
competes with ZFS for RAM. In the past ZFS used to give up memory way
too easily. Currently it's a bit more balanced, but is still far from
perfect.

By the way, if you don't have on-disk swap configured, I'd recommend
adding some. It may help avoiding processes being killed during
intermittent memory shortages.

If would also help if you could post your /boot/loader.conf and output
of "zfs-stats -a" (available in ports).

--Artem



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTiktQhwSUHWnMB8X3Yznce0_RM8nVg>