Bug #2835


fadvise memory leak in FreeBSD 8.3-RELEASE

Added by Phillip Davis about 11 years ago. Updated about 11 years ago.

Operating System
Target version:
Start date:
Due date:
% Done:


Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
Affected Architecture:


From pfSense forum,59249.0.html :
Apparently there is a memory leak in the posix_fadvise function in FreeBSD 8.3-RELEASE which has been fixed in the 8-STABLE mainline. My nanoBSD system has leaked 5MB in a couple of days of uptime:
vmstat -m | grep fadvise
fadvise 164447 5139K - 164447 32

That would become significant when a 256MB nanoBSD system is up for a month. After rebooting, the fadvise usage starts back at 1K and slowly increases.
FreeBSD 8.3 release notes have references to posix_fadvise -
This FreeBSD forum thread has some symptoms etc -
and this thread indicates that RRDtool uses posix_fadvise, running up kernel memory leaks -
and the fix (claimed) is here -
Can someone see if this is a good fix, is worth doing and is possible to patch into the pfSense FreeBSD 8.3?
I am happy to pre-test a build with this in it, if needed.

Actions #1

Updated by Renato Botelho about 11 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

Applied in changeset pfsense-tools:commit:548949d8726b5660d288336e8679e48f3b8cd2ff.

Actions #2

Updated by Phillip Davis about 11 years ago

From a system before upgrade:
[2.1-BETA1]/root(1): uptime
9:02AM up 2 days, 16:19, 2 users, load averages: 1.56, 1.87, 1.32
[2.1-BETA1]/root(1):vmstat -m | grep fadvise
fadvise 56389 1763K - 56389 32
and demonstrating that the leak can be seen straight after a reboot:
[2.1-BETA1]/root(2): uptime
9:29AM up 7 mins, 2 users, load averages: 0.30, 1.22, 0.86
[2.1-BETA1]/root(3): vmstat -m | grep fadvise
fadvise 118 4K - 118 32

After upgrading to Sun Feb 24 15:44:36 EST 2013:
[2.1-BETA1]/root(1): uptime
9:52AM up 1:28, 3 users, load averages: 0.24, 0.59, 0.68
[2.1-BETA1]/root(2): vmstat -m | grep fadvise
fadvise 0 0K - 2008 32

Leak is plugged! Thanks for the quick action.

Actions #3

Updated by Chris Buechler about 11 years ago

  • Status changed from Feedback to Resolved

Also available in: Atom PDF