Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Oct 2014 22:44:03 -0400
From:      Ryan Stone <rysto32@gmail.com>
To:        Paul Koch <paul.koch@akips.com>
Cc:        "freebsd-stable@freebsd.org" <freebsd-stable@freebsd.org>
Subject:   Re: Suspected kernel memory leak with mmap/sha1 ?
Message-ID:  <CAFMmRNyBWGNN3279gnhaPOYdf5PsHJf7CdUPKPy96Xz8_svHzw@mail.gmail.com>
In-Reply-To: <20141030100853.65a62326@akips.com>
References:  <20141030100853.65a62326@akips.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is normal behaviour.  Active (and inactive) memory comprises both
application memory and system disk cache.  By reading in all of those
files, you have loaded the contents of those files into the cache,
which is counted as active memory.  The kernel has no preference
between disk cache or application memory.  Its decisions as to whether
to swap application data out to disk or discard a page of disk cache
are mainly based on the VM system's estimates of how often that data
is being read.

One test that you could perform is to run your app with swap disabled.
If your application runs faster with swap disabled, that indicates
that the VM subsystem's heuristics are suboptimal for your workload
and some tuning might be necessary.  If your application runs at the
same speed or slower, then the VM subsystem is making correct (if
counter-intuitive) decisions performance-wise.  In that case, if your
performance is still unacceptable then your options are either to tune
your app's algorithm to reduce its working set (including application
and file data) to fit into memory, or install more memory in the
machine.



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