Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 07 Aug 2018 14:58:16 +0200
From:      Mark Martinec <Mark.Martinec+freebsd@ijs.si>
To:        stable@freebsd.org
Cc:        Mark Johnston <markj@freebsd.org>
Subject:   Re: All the memory eaten away by ZFS 'solaris' malloc - on 11.1-R amd64
Message-ID:  <a1e730def80ae4d188f5ba782b70b46d@ijs.si>
In-Reply-To: <20180804194757.GD12146@raichu>
References:  <1a039af7758679ba1085934b4fb81b57@ijs.si> <3e56e4de076111c04c2595068ba71eec@ijs.si> <20180731220948.GA97237@raichu> <2ec91ebeaba54fda5e9437f868d4d590@ijs.si> <b3aa2bbe947914f8933b24cf0d0b15f0@ijs.si> <20180804170154.GA12146@raichu> <87f6a55cc2ee3d754ddb89475bbfbab8@ijs.si> <20180804194757.GD12146@raichu>

next in thread | previous in thread | raw e-mail | index | archive | help
> On Sat, Aug 04, 2018 at 08:38:04PM +0200, Mark Martinec wrote:
>> 2018-08-04 19:01, Mark Johnston wrote:
>> > I think running "zpool list" is adding a lot of noise to the output.
>> > Could you retry without doing that?
>> No, like I said previously, the "zpool list" (with one defunct
>> zfs pool) *is* the sole culprit of the zfs memory leak.
>> With each invocation of "zpool list" the "solaris" malloc
>> jumps up by the same amount, and never ever drops. Without
>> running it (like repeatedly under 'telegraf' monitoring
>> of zfs), the machine runs normally and never runs out of
>> memory, the "solaris" malloc count no longer grows steadily.

2018-08-04 21:47, Mark Johnston wrote:
> Sorry, I missed that message.  Given that information, it would be
> useful to see the output of the following script instead:
> 
> # dtrace -c "zpool list -Hp" -x temporal=off -n '
>              dtmalloc::solaris:malloc
>                /pid == $target/{@allocs[stack(), args[3]] = count()}
> 	     dtmalloc::solaris:free
> 	       /pid == $target/{@frees[stack(), args[3]] = count();}'
> 
> This will record all allocations and frees from a single instance of
> "zpool list".


Collected, here it is:

   https://www.ijs.si/usr/mark/tmp/dtrace-cmd.out.bz2



Kevin P. Neal wrote:
> Was there a mention of a defunct pool?

Indeed.
Haven't tried yet to destroy it, so it is only my hypothesis
that a defunct pool plays a role in this leak.

> I've got a machine with 8GB RAM running 11.1-RELEASE-p4 with a single 
> ZFS
> pool. It runs zfs list in a script multiple times a minute, and it has
> been doing so for 181 days with no reboot. I have not seen any memory
> issues.

I have jumped from 10.3 directly to 11.1-RELEASE-p11, so I'm not sure
with exactly which version / patch level the problem was introduced.

Tried to reproduce the problem on another host running 11.2R,
using memory disk (md), created GPT partition on it and a ZFS pool
on top, then destroyed the disk, so the pool was left as UNAVAILABLE.
Unfortunately this did not reproduce the problem, the "zpool list"
on that host does not cause ZFS to leak memory. Must be something
specific to that failed disk or pool, which is causing the leak.

   Mark



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