Memory leak in ZFS?

Jeremy Faulkner gldisater at gmail.com
Tue Feb 8 21:03:03 UTC 2011


On 02/08/11 14:55, Bartosz Stec wrote:
> W dniu 2011-02-08 11:48, Bartosz Stec pisze:
> We didn't need to wait 2 days :)
> Now I can confirm that sendfile under SAMBA + ZFS are responsible for
> issue. Here's sample output from my monitoring script[1] (update every 2
> seconds):
>
> PHYSMEM: 2027.41 MB
> ACTIVE: 61.14 MB
> INACTIVE: 40.01 MB
> WIRED: 1303.86 MB
> CACHED: .50 MB
> FREE: 552.30 MB
> SUM: 1957.82 MB
> ------------------------
> MISSING: 69.58 MB
>
> PHYSMEM: 2027.41 MB
> ACTIVE: 61.14 MB
> INACTIVE: 40.07 MB
> WIRED: 1303.86 MB
> CACHED: .50 MB
> FREE: 551.80 MB
> SUM: 1957.38 MB
> ------------------------
> MISSING: 70.02 MB
>
> PHYSMEM: 2027.41 MB
> ACTIVE: 61.14 MB
> INACTIVE: 40.13 MB
> WIRED: 1303.86 MB
> CACHED: .50 MB
> FREE: 551.30 MB
> SUM: 1956.94 MB
> ------------------------
> MISSING: 70.46 MB
>
> PHYSMEM: 2027.41 MB
> ACTIVE: 61.14 MB
> INACTIVE: 40.19 MB
> WIRED: 1303.86 MB
> CACHED: .50 MB
> FREE: 550.80 MB
> SUM: 1956.51 MB
> ------------------------
> MISSING: 70.89 MB
>
> PHYSMEM: 2027.41 MB
> ACTIVE: 61.14 MB
> INACTIVE: 40.24 MB
> WIRED: 1303.86 MB
> CACHED: .50 MB
> FREE: 550.42 MB
> SUM: 1956.18 MB
> ------------------------
> MISSING: 71.22 MB
>
> PHYSMEM: 2027.41 MB
> ACTIVE: 61.14 MB
> INACTIVE: 40.30 MB
> WIRED: 1303.86 MB
> CACHED: .50 MB
> FREE: 549.92 MB
> SUM: 1955.74 MB
> ------------------------
> MISSING: 71.66 MB
>
> PHYSMEM: 2027.41 MB
> ACTIVE: 61.14 MB
> INACTIVE: 40.38 MB
> WIRED: 1303.86 MB
> CACHED: .50 MB
> FREE: 549.30 MB
> SUM: 1955.19 MB
> ------------------------
> MISSING: 72.21 MB
>
> PHYSMEM: 2027.41 MB
> ACTIVE: 61.14 MB
> INACTIVE: 40.44 MB
> WIRED: 1303.86 MB
> CACHED: .50 MB
> FREE: 548.80 MB
> SUM: 1954.76 MB
> ------------------------
> MISSING: 72.64 MB
>
> This behaviour has been seen while copying 600MB file from SAMBA share
> with sendfile enabled.
> It doesn't happen when writing to samba share, and it doesn't happen
> with sendfile disabled, both ways.
> For me it looks like memory which leaks should be added to wired pool
> and belongs to ARC, but appareantly this doesn't work well and WIRED:
> 1303.86 MB all the time.
>
> [1] http://pastebin.com/sQUyQbmm
>

Also occurring with the zfsv28 patch for 8-STABLE

gldisater at constans:~% zpool upgrade
This system is currently running ZFS pool version 28.

All pools are formatted using this version.
gldisater at constans:~% sh memleak-detect.sh
PHYSMEM: 12268.94 MB
ACTIVE: 427.57 MB
INACTIVE: 724.98 MB
WIRED: 10155.28 MB
CACHED: 28.32 MB
FREE: 556.16 MB
SUM: 11892.32 MB
------------------------
MISSING: 376.61 MB

gldisater at constans:~% uname -a
FreeBSD constans 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #14: Tue Jan 18 
15:26:02 EST 2011     root at constans:/usr/obj/usr/src/sys/CONSTANS  amd64
gldisater at constans:~% uptime
  3:22PM  up 8 days,  5:07, 2 users, load averages: 0.21, 0.22, 0.24


-- 
Jeremy Faulkner


More information about the freebsd-fs mailing list