Memory leak?

Over how many days have you observed this?

An increasing memory footprint is perfectly normal as FTL holds all queries in memory to generate the statistics from. However, it is very memory efficient and will drop those queries that are older than 24 hours. After a full 24 hours of normal browsing activity, the memory footprint should stay stable and does not increase notably - if at all - afterwards.
We do this to use the least amount of memory as possible. The alternative would be to block a huge chunk of memory from the beginning which seems to be a much unfriendlier behavior.

What are the outputs of these terminal commands:

echo ">stats" | nc localhost 4711

ls -l -h /etc/pihole/pihole-FTL.db

domains_being_blocked 112495
dns_queries_today 0
ads_blocked_today 0
ads_percentage_today 0.000000
unique_domains 0
queries_forwarded 0
queries_cached 0
clients_ever_seen 0
unique_clients 0
dns_queries_all_types 0
reply_NODATA 0
reply_NXDOMAIN 0
reply_CNAME 0
reply_IP 0
privacy_level 4
status enabled
---EOM---

I observed this over several days. always increasing memory usage although I have completely disabled logging.

The developers will take a look at this in the next several days to week. Stay tuned.

1 Like

is this a known bug or am I the only one who encountered this? I am using a very stock experience, since I have not added any other block lists etc.

There is no known bug with memory leaks but it might be related to you running the no-logging setup which is (probably) not used very often so it might very well be that you spotted a so far unknown bug. I will try to reproduce this over the next few days.

I noticed this memory increase so I tried the "no logging" option. unfortunately it did not help.

Okay, good to know, so I don't have to look for a bug isolated to the no-logging mode. The memory usage of pihole-FTL is fairly linearly correlated with the number of queries shown on the dashboard.
Screenshot%20from%202019-01-21%2020-04-16
Do you observe this number growing over time as well?

although I have logging turned on again "sudo pihole logging on" there is 0 queries and 0 clients shown :frowning:

Please run another debug log, upload it and post the token here.

done. no logging is happening although it has been turned on in the UI and in the pi through SSH manually:

w83wm9xgkw

[2019-01-21 20:54:59.151] PRIVACYLEVEL: Set to 4

With your privacy level set to 4, you have no query counters or statistics, regardless of the Pi-Hole logging setting.

https://docs.pi-hole.net/ftldns/privacylevels/

Level 4 - disabled statistics (v4.1+)¶

Disables all statistics processing. Even the query counters will not be available. Additionally, you can disable logging to the file /var/log/pihole.log using sudo pihole logging off.

Note that - due to the disabled query processing - regex blocking is not available on level 4.

good to know. does privacy level/logging have an impact on performance on the pi zero?

No. I use a few Zero W's with logging on. They both resolve DNS quickly.

You can disable /var/log/pihole.log with no ill effects on your dashboard (that data will come from the long term database). The downside is that you won't have a live log to tail, so if you want that you would need to enable the /var/log/pihole.log.

I enabled logging again and memory usage is still increasing permanently.

Please post the output of this command again.

echo ">stats" | nc localhost 4711

I got a Zero W running for 30 days stay at 100 mb used, about 660k domains in list

echo ">stats" | nc localhost 4711
domains_being_blocked 112495
dns_queries_today 20883
ads_blocked_today 2375
ads_percentage_today 11.372887
unique_domains 2079
queries_forwarded 13955
queries_cached 4553
clients_ever_seen 11
unique_clients 11
dns_queries_all_types 20883
reply_NODATA 1954
reply_NXDOMAIN 1202
reply_CNAME 6631
reply_IP 7227
privacy_level 0
status enabled
---EOM---

Can you run htop every few hours and see which process has the increasing memory load? Just for comparison, htop for a Zero W running the master branch, the default blocklists, NULL blocking is shown below: