FreeBSD Port: dns/bind920 steadily increasing memory usage

Ondřej Surý ondrej at isc.org
Tue Sep 16 03:58:09 UTC 2025


Hi Felix,

thanks for willing to debug the issue. Here's a primer:

https://www.isc.org/blogs/2023-BIND-memory-management-explained/

The basics are:

1. configure stats channel
2. look at the memory distribution (internal) to see where the memory goes
3. if there's a really runaway memory, we can use the jemalloc profiling to see exactly where the memory goes

Ondrej
--
Ondřej Surý (He/Him)
ondrej at isc.org

My working hours and your working hours may be different. Please do not feel obligated to reply outside your normal working hours.

> On 15. 9. 2025, at 23:03, Felix J. Ogris <fjo-lists at ogris.de> wrote:
> 
> Hi,
> 
> I have noticed that Bind 9.20.x on FreeBSD 14.2 and 14.3 consumes more and more memory when being used as a resolver.
> While top reports a SIZE of 4800 MB and RES of 4600 MB, the XML statistics channel just reports 209053061 bytes for both malloced and in use. This instance has been running for about 11 days.
> Relevant named.conf snippets:
> 
> zone-statistics no;
> dnssec-validation no;
> max-cache-size 1024M;
> 
> memstatistics has not been set.
> 
> There are 169 (3 automatic) zones configured statically to ground zone "127.in-addr.arpa", zone "example.com", and such. No RPZs, no dynamic zone updates. It runs as unprivileged user in a chroot on a VM with 2 CPU cores.
> rndc flush did never release any memory. Instead, I sporadically observed SIZE increasing as soon as rndc flush returned.
> On the very same system, Bind 9.18.x levels off around 300-400 megs, even when it had been running for several weeks.
> Both 9.20.x and 9.18.x were compiled locally from the FreeBSD ports system using just these four options:
> 
> IDN (International Domain Names support)
> TCP_FASTOPEN (RFC 7413 support)
> STATS_XML (Enable XML statistics channel)
> GSSAPI_NONE
> 
> FreeBSD 14.3 provides clang version 19.1.7 as C compiler, and jemalloc 5.2.1-0 as system memory allocator. Machine type is amd64.
> As the memory usage of my resolver at home grows more slowly, I assume the growth rate depends on the number of queries and/or answers.
> When being used as an authorative server, Bind 9.20 uses very little memory and does not increase, comparable to 9.18.
> I am willed to debug this behaviour, but will need support to do so. Any suggestions are welcome.
> 
> -Felix
> -- 
> Visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list.



More information about the bind-users mailing list