Memory behavior and disabling Pi-Hole

@anon55913113 can you tell me where that database is located? pihole-FTL.db is only for reports: in the query table in this database all pihole.log info is stored: time, type status, domain, client and forward. The admin page info is retrieved form this dB.

I always though that the grafity.list file is read and written in memory.
In old FTL versions included IPv4 and 6 addresses. Nowadays I don't know if this still is so.
But at the moment I think there is a bug in handling this process. With a small grafity.list files extra memory usage is not seen. When grafity.list is a big list (> 1 million domains) the extra usage is remarkable.

I just have done another test. Pickup an old SD card image with PiHole 4.0 and stretch on a PiOne.
Update the OS and after that PiHole.
With the same Pihole settings and the same addlist file, the memory usage of FTL grows from 254 MB to 470 MB (55% to 94% memory usage).
I don't use DHCP. PiHole is a client of DHCP of the internet modem.

In the picture the HTOP before (on top) and after (bottom) the PiHole update from 4.0 to 4.23. Same addlist used.

Before I have done that I have taken a loop at HTOP
The FTL usage is still 470 MB, in memory 189 MB, the rest in virtual memory (which is full now).
Memory usage in the webpage is is 67% (was 94%). So more free memory, but it's in virtual memory.
The PiOne is only for tests; no clients are connected; no traffic

The command was: pihole disable #30
After a pihole restartdns reload the PiHole still stays offline (status lamp in webadmin page is red). Also with sudo service pihole-FTL restart.
Domains on blocklist is 0 and stays 0. HTOP shows FTL in memory; uses 81 MB

I have done a reboot. The pihole-FTL.log shows:

[2019-02-27 21:49:51.542 1208] Skipping commented out regex filter on line 178
[2019-02-27 21:49:51.542 1208] Skipping commented out regex filter on line 179
[2019-02-27 21:49:51.547 1208] Compiled 174 Regex filters and 134 whitelisted domains in 31.1 msec (0 errors)
[2019-02-27 21:49:51.550 1208] /etc/pihole/black.list: parsed 0 domains (took 0.2 ms)
[2019-02-27 21:49:51.551 1208] /etc/pihole/gravity.list: parsed 0 domains (took 0.2 ms)
[2019-02-27 21:52:50.891 1208] Shutting down...
[2019-02-27 21:52:51.274 1208] Finished final database update
[2019-02-27 21:52:51.281 1208] ########## FTL terminated after 180761.9 ms! ##########
[2019-02-27 21:52:59.263 1045] Using log file /var/log/pihole-FTL.log
[2019-02-27 21:52:59.263 1045] ########## FTL started! ##########
[2019-02-27 21:52:59.263 1045] FTL branch: master
[2019-02-27 21:52:59.263 1045] FTL version: v4.2.3
[2019-02-27 21:52:59.263 1045] FTL commit: aae487e
[2019-02-27 21:52:59.263 1045] FTL date: 2019-02-25 17:18:14 -0800
[2019-02-27 21:52:59.264 1045] FTL user: pihole
[2019-02-27 21:52:59.264 1045] Starting config file parsing (/etc/pihole/pihole-FTL.conf)
[2019-02-27 21:52:59.265 1045] SOCKET_LISTENING: only local
[2019-02-27 21:52:59.265 1045] AAAA_QUERY_ANALYSIS: Hide AAAA queries
[2019-02-27 21:52:59.265 1045] MAXDBDAYS: max age for stored queries is 365 days
[2019-02-27 21:52:59.265 1045] RESOLVE_IPV6: Resolve IPv6 addresses
[2019-02-27 21:52:59.265 1045] RESOLVE_IPV4: Resolve IPv4 addresses
[2019-02-27 21:52:59.265 1045] DBINTERVAL: saving to DB file every 300 seconds
[2019-02-27 21:52:59.265 1045] DBFILE: Using /etc/pihole/pihole-FTL.db
[2019-02-27 21:52:59.265 1045] MAXLOGAGE: Importing up to 24.0 hours of log data
[2019-02-27 21:52:59.266 1045] PRIVACYLEVEL: Set to 0
[2019-02-27 21:52:59.266 1045] IGNORE_LOCALHOST: Show queries from localhost
[2019-02-27 21:52:59.266 1045] BLOCKINGMODE: Pi-hole's IPs for blocked domains
[2019-02-27 21:52:59.266 1045] REGEX_DEBUGMODE: Inactive
[2019-02-27 21:52:59.266 1045] ANALYZE_ONLY_A_AND_AAAA: Disabled. Analyzing all queries
[2019-02-27 21:52:59.266 1045] DBIMPORT: Importing history from database
[2019-02-27 21:52:59.267 1045] PIDFILE: Using /var/run/pihole-FTL.pid
[2019-02-27 21:52:59.267 1045] PORTFILE: Using /var/run/pihole-FTL.port
[2019-02-27 21:52:59.267 1045] SOCKETFILE: Using /var/run/pihole/FTL.sock
[2019-02-27 21:52:59.267 1045] WHITELISTFILE: Using /etc/pihole/whitelist.txt
[2019-02-27 21:52:59.267 1045] BLACKLISTFILE: Using /etc/pihole/black.list
[2019-02-27 21:52:59.267 1045] GRAVITYFILE: Using /etc/pihole/gravity.list
[2019-02-27 21:52:59.267 1045] REGEXLISTFILE: Using /etc/pihole/regex.list
[2019-02-27 21:52:59.267 1045] SETUPVARSFILE: Using /etc/pihole/setupVars.conf
[2019-02-27 21:52:59.268 1045] AUDITLISTFILE: Using /etc/pihole/auditlog.list
[2019-02-27 21:52:59.268 1045] Finished config file parsing
[2019-02-27 21:52:59.331 1045] Database successfully initialized
[2019-02-27 21:52:59.354 1045] New forward server: 146.185.176.36 (0/4096)
[2019-02-27 21:52:59.355 1045] New forward server: 51.15.98.97 (1/4096)
[2019-02-27 21:52:59.364 1045] Imported 356 queries from the long-term database
[2019-02-27 21:52:59.364 1045] -> Total DNS queries: 356
[2019-02-27 21:52:59.364 1045] -> Cached DNS queries: 246
[2019-02-27 21:52:59.365 1045] -> Forwarded DNS queries: 110
[2019-02-27 21:52:59.365 1045] -> Exactly blocked DNS queries: 0
[2019-02-27 21:52:59.365 1045] -> Unknown DNS queries: 0
[2019-02-27 21:52:59.365 1045] -> Unique domains: 40
[2019-02-27 21:52:59.365 1045] -> Unique clients: 1
[2019-02-27 21:52:59.365 1045] -> Known forward destinations: 2
[2019-02-27 21:52:59.365 1045] Successfully accessed setupVars.conf
[2019-02-27 21:53:00.192 1195] PID of FTL process: 1195
[2019-02-27 21:53:00.192 1195] Listening on port 4711 for incoming IPv4 telnet connections
[2019-02-27 21:53:00.193 1195] Listening on port 4711 for incoming IPv6 telnet connections
[2019-02-27 21:53:00.194 1195] Listening on Unix socket
[2019-02-27 21:53:00.249 1195] Skipping commented out regex filter on line 1
[2019-02-27 21:53:00.249 1195] Skipping commented out regex filter on line 2
[2019-02-27 21:53:00.249 1195] Skipping commented out regex filter on line 3
[2019-02-27 21:53:00.268 1195] Skipping commented out regex filter on line 177
[2019-02-27 21:53:00.268 1195] Skipping commented out regex filter on line 178
[2019-02-27 21:53:00.269 1195] Skipping commented out regex filter on line 179
[2019-02-27 21:53:00.275 1195] Compiled 174 Regex filters and 134 whitelisted domains in 31.6 msec (0 errors)
[2019-02-27 21:53:00.278 1195] /etc/pihole/black.list: parsed 0 domains (took 0.3 ms)
[2019-02-27 21:53:00.279 1195] /etc/pihole/gravity.list: parsed 0 domains (took 0.2 ms)

Next reboot gives the same results.
Maybe FTL is crashed, HTOP shows that it is still there.
I have done a shutdown, power off and power on. Same result.

Some research shows that after pihole disable #30 the file gravity.list is 1 kb and contains only a line feed. HTOP shows 463 MB memory usage by FTL.
After 2 minutes the webinterface still shows Offline and high memory usage (95%). Domains on blocklist: 0
After sudo pihole restartdns reload the PiHole is Offline, high memory usage (95%), domains on blocklist: 0 and gravity.list is 1 KB

Enable it using the 'enable function' of the webinterface; the original gravity.list is back again in /etc/pihole.
PiHole is Offline, high memory usage (95%), domains on blocklist: 2.7 million and gravity.list is 54 MB

Conclusion:

  • disable pihole for x minutes shows that the block table during this period is still in memory (HTOP). A pihole restartdns reload command doesn't work. The return message is 'Reloading DNS service' but it doesn't. You have to use the "enable" button on the admin webpage. After some times it shows 2.7 million blocked domains and active
  • the command line disable #30 doesn't automatically end with an enabled PiHole. I think a software bug. It's reproducable.

The pihole-FTL.log file:

[2019-02-27 22:23:21.189 3035] Skipping commented out regex filter on line 1
[2019-02-27 22:23:21.189 3035] Skipping commented out regex filter on line 2
[2019-02-27 22:23:21.189 3035] Skipping commented out regex filter on line 3
[2019-02-27 22:23:21.203 3035] Skipping commented out regex filter on line 177
[2019-02-27 22:23:21.203 3035] Skipping commented out regex filter on line 178
[2019-02-27 22:23:21.203 3035] Skipping commented out regex filter on line 179
[2019-02-27 22:23:21.209 3035] Compiled 174 Regex filters and 134 whitelisted domains in 27.8 msec (0 errors)
[2019-02-27 22:23:28.458 3035] /etc/pihole/black.list: parsed 0 domains (took 0.1 ms)
[2019-02-27 22:23:28.459 3035] /etc/pihole/gravity.list: parsed 0 domains (took 0.1 ms)
[2019-02-27 22:27:44.688 3035] Skipping commented out regex filter on line 1
[2019-02-27 22:27:44.688 3035] Skipping commented out regex filter on line 2
[2019-02-27 22:27:44.688 3035] Skipping commented out regex filter on line 3
[2019-02-27 22:27:44.701 3035] Skipping commented out regex filter on line 177
[2019-02-27 22:27:44.701 3035] Skipping commented out regex filter on line 178
[2019-02-27 22:27:44.701 3035] Skipping commented out regex filter on line 179
[2019-02-27 22:27:44.707 3035] Compiled 174 Regex filters and 134 whitelisted domains in 24.6 msec (0 errors)
[2019-02-27 22:27:44.730 3035] /etc/pihole/black.list: parsed 0 domains (took 0.1 ms)
[2019-02-27 22:27:44.731 3035] /etc/pihole/gravity.list: parsed 0 domains (took 0.1 ms)
[2019-02-27 22:29:18.547 3035] Skipping commented out regex filter on line 1
[2019-02-27 22:29:18.547 3035] Skipping commented out regex filter on line 2
[2019-02-27 22:29:18.547 3035] Skipping commented out regex filter on line 3
[2019-02-27 22:29:18.561 3035] Skipping commented out regex filter on line 177
[2019-02-27 22:29:18.561 3035] Skipping commented out regex filter on line 178
[2019-02-27 22:29:18.561 3035] Skipping commented out regex filter on line 179
[2019-02-27 22:29:18.566 3035] Compiled 174 Regex filters and 134 whitelisted domains in 21.0 msec (0 errors)
[2019-02-27 22:29:18.587 3035] /etc/pihole/black.list: parsed 0 domains (took 0.1 ms)
[2019-02-27 22:29:43.908 3035] /etc/pihole/gravity.list: parsed 2775234 domains (took 25319.6 ms)
[2019-02-27 22:35:38.318 3035] Skipping commented out regex filter on line 1
[2019-02-27 22:35:38.319 3035] Skipping commented out regex filter on line 2
[2019-02-27 22:35:38.319 3035] Skipping commented out regex filter on line 3
[2019-02-27 22:35:38.346 3035] Skipping commented out regex filter on line 177
[2019-02-27 22:35:38.346 3035] Skipping commented out regex filter on line 178
[2019-02-27 22:35:38.346 3035] Skipping commented out regex filter on line 179
[2019-02-27 22:35:38.352 3035] Compiled 174 Regex filters and 134 whitelisted domains in 41.5 msec (0 errors)
[2019-02-27 22:35:46.549 3035] /etc/pihole/black.list: parsed 0 domains (took 0.1 ms)
[2019-02-27 22:35:46.550 3035] /etc/pihole/gravity.list: parsed 0 domains (took 0.1 ms)
[2019-02-27 22:37:24.506 3035] Skipping commented out regex filter on line 1
[2019-02-27 22:37:24.506 3035] Skipping commented out regex filter on line 2
[2019-02-27 22:37:24.506 3035] Skipping commented out regex filter on line 3
[2019-02-27 22:37:24.520 3035] Skipping commented out regex filter on line 177
[2019-02-27 22:37:24.520 3035] Skipping commented out regex filter on line 178
[2019-02-27 22:37:24.520 3035] Skipping commented out regex filter on line 179
[2019-02-27 22:37:24.532 3035] Compiled 174 Regex filters and 134 whitelisted domains in 32.3 msec (0 errors)
[2019-02-27 22:37:24.560 3035] /etc/pihole/black.list: parsed 0 domains (took 0.7 ms)
[2019-02-27 22:37:24.561 3035] /etc/pihole/gravity.list: parsed 0 domains (took 0.1 ms)
[2019-02-27 22:39:13.023 3035] Skipping commented out regex filter on line 1
[2019-02-27 22:39:13.023 3035] Skipping commented out regex filter on line 2
[2019-02-27 22:39:13.024 3035] Skipping commented out regex filter on line 3
[2019-02-27 22:39:13.050 3035] Skipping commented out regex filter on line 177
[2019-02-27 22:39:13.051 3035] Skipping commented out regex filter on line 178
[2019-02-27 22:39:13.051 3035] Skipping commented out regex filter on line 179
[2019-02-27 22:39:13.057 3035] Compiled 174 Regex filters and 134 whitelisted domains in 36.9 msec (0 errors)
[2019-02-27 22:39:13.090 3035] /etc/pihole/black.list: parsed 0 domains (took 0.1 ms)
[2019-02-27 22:39:46.730 3035] /etc/pihole/gravity.list: parsed 2775234 domains (took 33622.4 ms)

This is the mechanism Pi-Hole uses to disable itself. It moves the gravity liist and blacklist to temporary files, and replaces them with empty files. This results in zero blocking (the desired outcome). When Pi-Hole is re-enabled, the original gravity and black lists are restored.

Can this behavior be reproduced if you run the original seven block lists that ship with Pi-Hole (about 118K domains on blocklist)?

Generate a debug log, post the token and also post your /etc/pihole/regex.list here. I'll try to duplicate the problem you are seeing.

Debug token: 2d4k16hi38

The regex list download: https://www.dropbox.com/s/k7xmynrr0efe2v7/regex.zip?dl=1

For your test I have used this addlist.list:
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
https://mirror1.malwaredomains.com/files/justdomains
http://sysctl.org/cameleon/hosts
https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist
https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
https://hosts-file.net/ad_servers.txt

After pihole disable #30 the status is Offline and 0 Domains on Blocklistst
HTOP shows that PiHole uses 464MB memory. gravity.list is 1KB. Memory usage 84%.

After sudo pihole restartdns reload the status is Offline and 0 Domains on Blocklistst
HTOP shows that PiHole uses 464MB memory. gravity.list is 1KB. Memory usage 84%.

After "Enable" using the web interface: the status is Active and 112k Domains on Blocklistst
HTOP shows that PiHole uses 464MB memory. gravity.list is back again 5.169 KB. Memory usage 84%.

Strange effect is that the FTL used memory stays on 464MB and memory usage is high.
I don't use the Pihole as a DHCP server; it's a client of my router.

pihole-FTL.log logfile:

[2019-02-27 23:18:39.724 3035] WARN: Regex evaluation took 10.413 msec
[2019-02-27 23:19:03.684 3035] Skipping commented out regex filter on line 1
[2019-02-27 23:19:03.685 3035] Skipping commented out regex filter on line 2
[2019-02-27 23:19:03.685 3035] Skipping commented out regex filter on line 3
[2019-02-27 23:19:03.702 3035] Skipping commented out regex filter on line 177
[2019-02-27 23:19:03.702 3035] Skipping commented out regex filter on line 178
[2019-02-27 23:19:03.702 3035] Skipping commented out regex filter on line 179
[2019-02-27 23:19:03.704 3035] Compiled 174 Regex filters and 134 whitelisted domains in 20.0 msec (0 errors)
[2019-02-27 23:19:20.153 3035] /etc/pihole/black.list: parsed 39 domains (took 2.4 ms)
[2019-02-27 23:19:21.317 3035] /etc/pihole/gravity.list: parsed 112854 domains (took 1147.4 ms)
[2019-02-27 23:19:34.585 3035] WARN: Regex evaluation took 11.369 msec
[2019-02-27 23:19:55.297 3035] Skipping commented out regex filter on line 1
[2019-02-27 23:19:55.298 3035] Skipping commented out regex filter on line 2
[2019-02-27 23:19:55.298 3035] Skipping commented out regex filter on line 3
[2019-02-27 23:19:55.312 3035] Skipping commented out regex filter on line 177
[2019-02-27 23:19:55.313 3035] Skipping commented out regex filter on line 178
[2019-02-27 23:19:55.313 3035] Skipping commented out regex filter on line 179
[2019-02-27 23:19:55.318 3035] Compiled 174 Regex filters and 134 whitelisted domains in 22.7 msec (0 errors)
[2019-02-27 23:19:55.708 3035] /etc/pihole/black.list: parsed 39 domains (took 0.5 ms)
[2019-02-27 23:19:56.741 3035] /etc/pihole/gravity.list: parsed 112862 domains (took 1032.3 ms)
[2019-02-27 23:20:31.197 3035] Skipping commented out regex filter on line 1
[2019-02-27 23:20:31.198 3035] Skipping commented out regex filter on line 2
[2019-02-27 23:20:31.198 3035] Skipping commented out regex filter on line 3
[2019-02-27 23:20:31.211 3035] Skipping commented out regex filter on line 177
[2019-02-27 23:20:31.211 3035] Skipping commented out regex filter on line 178
[2019-02-27 23:20:31.211 3035] Skipping commented out regex filter on line 179
[2019-02-27 23:20:31.217 3035] Compiled 174 Regex filters and 134 whitelisted domains in 20.8 msec (0 errors)
[2019-02-27 23:20:31.589 3035] /etc/pihole/black.list: parsed 0 domains (took 0.1 ms)
[2019-02-27 23:20:31.589 3035] /etc/pihole/gravity.list: parsed 0 domains (took 0.1 ms)
[2019-02-27 23:24:22.946 3035] Skipping commented out regex filter on line 1
[2019-02-27 23:24:22.947 3035] Skipping commented out regex filter on line 2
[2019-02-27 23:24:22.947 3035] Skipping commented out regex filter on line 3
[2019-02-27 23:24:22.967 3035] Skipping commented out regex filter on line 177
[2019-02-27 23:24:22.967 3035] Skipping commented out regex filter on line 178
[2019-02-27 23:24:22.967 3035] Skipping commented out regex filter on line 179
[2019-02-27 23:24:22.972 3035] Compiled 174 Regex filters and 134 whitelisted domains in 27.8 msec (0 errors)
[2019-02-27 23:24:22.992 3035] /etc/pihole/black.list: parsed 0 domains (took 0.1 ms)
[2019-02-27 23:24:22.993 3035] /etc/pihole/gravity.list: parsed 0 domains (took 0.1 ms)
[2019-02-27 23:26:09.490 3035] Skipping commented out regex filter on line 1
[2019-02-27 23:26:09.490 3035] Skipping commented out regex filter on line 2
[2019-02-27 23:26:09.490 3035] Skipping commented out regex filter on line 3
[2019-02-27 23:26:09.503 3035] Skipping commented out regex filter on line 177
[2019-02-27 23:26:09.504 3035] Skipping commented out regex filter on line 178
[2019-02-27 23:26:09.504 3035] Skipping commented out regex filter on line 179
[2019-02-27 23:26:09.505 3035] Compiled 174 Regex filters and 134 whitelisted domains in 17.9 msec (0 errors)
[2019-02-27 23:26:09.524 3035] /etc/pihole/black.list: parsed 39 domains (took 0.5 ms)
[2019-02-27 23:26:10.558 3035] /etc/pihole/gravity.list: parsed 112862 domains (took 1034.2 ms)

After the "pihole disable #30" command I expected that after 30 seconds PiHole comes on line. But it doesn't; you have to use the enable button in the webinterface.

The # symbol is the placeholder for the numeral

pihole disable --help
Usage: pihole disable [time]
Example: 'pihole disable', or 'pihole disable 5m'
Disable Pi-hole subsystems

Time:
  #s                  Disable Pi-hole functionality for # second(s)
  #m                  Disable Pi-hole functionality for # minute(s)

So, the command was ok.
Then the problem stays that after 30 second, automatic enabling doesn't work. I expect that (same like on the web page)

Did you run pihole disable 30s, and if so what was the result? When I run that command as written, Pi-Hole re-enables at the 30 second mark.

I verified that with pihole disable #30 , Pi-Hole disables and stays disabled, as this is not the correct format of the command. Pi-Hole reads this as pihole disable and disables permanently.

With this is mind, all of the behavior you noted in your previous comments is expected. When Pi-Hole is disabled, it sets the BLOCKING_ENABLED flag in /etc/pihole/setupVars.conf.

When you restart the Pi, or restart FTL, this flag is read and respected, and the blocking-enabled behavior is not changed. It stays the way you commanded it.

It does not appear that there is a bug, but it was an incorrect disable command that produced this behavior.

I did a pihole disable #30.

Now I have done the test again but with pihole disable 30s

pihole disable 30s
[i] Disabling blocking for 30 seconds...
[✓] Reloading DNS service
[✓] Pi-hole Disabled

After that the status stays Active and 112k Domains on Blocklistst
HTOP shows that PiHole uses 110MB memory (not 464 MB as on yesterday because the PiOne was powered off). gravity.list is 2.5 MB. Memory usage 26,5%.
In my opinion this command doesn't work. PiHole is still active.

I have given the command: pihole disable #30 as I have done yesterday. Response:
[i] Disabling blocking
[✓] Reloading DNS service
[✓] Pi-hole Disabled

After that command the status is Offline and 0 Domains on Blocklistst
HTOP shows that PiHole uses 110MB memory. gravity.list is 1 KB. Memory usage 26,5%. That's ok.

It stays off line after this 30 secs
Giving the command sudo pihole restartdns reload
[✓] Reloading DNS service
the status is still Offline and 0 Domains on Blocklistst. That's not OK

After "Enable" using the web interface: the status is Active and 112k Domains on Blocklistst
HTOP shows that PiHole uses 110MB memory. gravity.list is back again 2.580 KB. Memory usage 26,5%.

I hope this makes it clear for you what I have done and their results.

Conclusions:

  1. The command 'pihole disable 30s' doesn't work. This is also not specified in the help, so that is correct. But a response text like 'Disabling blocking for 30 seconds...' in this case is wrong information.
  2. As written above, after the 30 secs. PiHole stays off line. In the webinterface there is a counter. When it's zero, PiHole is online automatically. With the command interface the behaviour is another: it stays offline.

Debug token: uveqboefyr

pihole disable #30 just turns off Pi-hole completely, pihole disable 30s disables for 30 seconds. Don't trust me, read the code. pi-hole/pihole at master · pi-hole/pi-hole · GitHub

@anon55913113
I read the forum on a regular base. Response emails are not leading in this. And I don't only react on messages depending of emails, but also read the other messages and will give a response on that if necessary or requested.

@DanSchaper
Thanks for the code in this and the difference of #30 and 30s
I have tested it again. 'Pihole disable 30s' disables PiHole and automatically enables it after 30 seconds of more. With #30 PiHole is disabled; a 'sudo service pihole-FTL restart' is needed for getting it online.
Both works correctly.

On topic:
The 2 current problems in general case are:

  • a huge memory usage by FTL since the update from 4.11 to 4.23, using the same addlist.list and unchanged PiHole configuration. With 112k blocked domains and a gravity.list file of 2.58 MB, 100MB RAM is used; in my opinion a lot.
  • if memory is allocated by FTL and you do a pihole -g with a smaller addlist than the first time, the leftover memory, needed for this smaller list in memory, is not given free

100MB of RAM is not a lot, especially with 112k domains. On a Raspberry Pi 3 you get 1024MB of RAM, why be concerned when you actually use what you paid for? Unused RAM is just wasted.

Obligitory "Linux Ate My RAM" link: https://www.linuxatemyram.com/

I have used the standard 112k list for a test for JFB and generating a debug file. Normaly I use a list of 3.6 million blocked domains (my own Pihole running on a PI3).
My problem is that my family uses a PiOne with 500 MB RAM with a list of 2 million domains. They still are on PiHole 4.11 which performs good. For test purposes I have done an update from 4.11 to 423 on my test PiOne. See the first message of this topic. With the same Pihole settings and the same addlist file, the memory usage of FTL grows from 254 MB to 470 MB (55% to 94% memory usage)! With 94% I can not advise my family to update their Pihole.

And also see FTL V4.2.2/4.2.3 consumes nearly 2x more memory then V4.11 for my own PiHole running on a PI3. The FTL proces uses 341 MB in version 4.11, now it’s 616 MB. Nearly 2 times more. Memory usage grows from 37% to 66%. With the same addlist and nothing changed in configuration.

MJMW has a same problem with his huge addlist; see Problem since update to 4.2.*

Why this high memory usage after the update? I think it's not only for the shared memory to the API, but that something is going wrong in storing the gravity.list into memory.

MJMW is trying to use malformed lists in his install. If you are doing the same then things will break. If you are grabbing lists that you have not reviewed for correctness then things will break. If you use random lists in order to get a huge number of blocked domains things will break.

I run the latest Pi-hole releases on a NanoPi Neo with 512M RAM, if this was a problem with the core code I would see it.

nanopineo:~$ free -h
              total        used        free      shared  buff/cache   available
Mem:           493M         91M        138M         24M        263M        366M
Swap:          246M        512K        246M

dschaper@nanopineo:~$ du -h /dev/shm
4.1M	/dev/shm
dschaper@nanopineo:~$ ls -lah /dev/shm
total 4.1M
drwxrwxrwt  2 root   root    220 Feb 26 19:26 .
drwxr-xr-x 14 root   root    14K Feb 21 05:33 ..
-rw-------  1 pihole pihole 2.5M Feb 26 19:26 FTL-clients
-rw-------  1 pihole pihole  108 Feb 26 19:26 FTL-counters
-rw-------  1 pihole pihole 128K Feb 28 11:46 FTL-domains
-rw-------  1 pihole pihole 160K Feb 26 19:26 FTL-forwarded
-rw-------  1 pihole pihole   28 Feb 28 13:09 FTL-lock
-rw-------  1 pihole pihole 8.0K Feb 26 19:26 FTL-overTime
-rw-------  1 pihole pihole 4.0M Feb 28 13:09 FTL-queries
-rw-------  1 pihole pihole   12 Feb 26 19:26 FTL-settings
-rw-------  1 pihole pihole  44K Feb 28 13:05 FTL-strings

why is that only a problem with 4.2.x, but until 4.1.2 it is a well performing system under the same cirumstances ?

It's not a problem with 4.2.x, 4.2 works properly and as designed. 4.1.2 didn't.

what was the problem with 4.1.x ?

Malformed lists were accepted and added to the number of domains blocked when in actuality none of the bad addresses would ever have blocked any clients.

was this the only 'problem' - because the number of blocked domains was the same with my 4.1.x pihole,
but on 4.1.x also dhcp worked..?