Raspberry Pi 4b 2GB RAM excessive shm usage

I am running pihole on two Raspberry Pi 4b 2Gb devbices in docker containers with the following compose details:

version: '3'

services:
  pihole:
    image: pihole/pihole:latest
    container_name: pihole
    hostname: ${HOSTNAME}
    network_mode: host
    shm_size: 768mb
    environment:
      - TZ=${TZ}
      - WEBPASSWORD=${WEBPASSWORD}
      - FTLCONF_LOCAL_IPV4=${FTLCONF_LOCAL_IPV4}
      - PIHOLE_DNS_=${PIHOLE_DNS}
      - REV_SERVER=${REV_SERVER}
      - REV_SERVER_DOMAIN=${REV_SERVER_DOMAIN}
      - REV_SERVER_TARGET=${REV_SERVER_TARGET}
      - REV_SERVER_CIDR=${REV_SERVER_CIDR}
      - DNSMASQ_LISTENING=all
      - WEB_PORT=${WEB_PORT}
      - FTLCONF_RATE_LIMIT=0/0
    volumes:
      - ${DIRECTORY_PIHOLE}:/etc/pihole/
      - ${DIRECTORY_DNSMASQ}:/etc/dnsmasq.d/
    restart: unless-stopped

Everything seems to be working well, but I've had to increase the swap file memory available to each container to 768mb.

My router is currently managing my DHCP requests. I was testing the use of conditional forwarding to get the names of local devices. Enabling this shut both containers down with "database locked" messages.

Turning it off enabled each container to come up, but it took a long time for the ftl-database to fix itself.

The first server debug token
The second server debug token

My question is, is there a more efficient way to manage this than using SHM?