Allowed memory size exhausted


  • Hello,

    A little bit of background info first:

    Our set up is 2 x 2.1.15 nodes running CARP.
    Recently I decided to disable DHCP on the backup node.
    The reason was it assigning IPs out of sync with the primary node.
    We have never seen duplicate IPs on the network.
    The problem was the master node's DNS (the default dnsmasq) couldn't resolve entries not present in its own DHCP lease table.
    So basically DHCP lease tables were out of sync.

    Now the error which only happens on backup node when I try to manually delete DHCP leases:

    https://x.x.x.x/status_dhcp_leases.php?deleteip=y.y.y.y&all=
    
    Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 2 bytes) in /usr/local/www/status_dhcp_leases.php on line 60
    

    Both nodes have 4GB of memory.
    The current memory usage is reporting as 15% on the master and 22% on the backup node (not sure why it's significantly more on backup).
    Any ideas regarding the php error?

    Thanks
    Adam


  • That line is:

    $leases_contents = file($leasesfile);
    

    How big is /var/dhcpd/var/db/dhcpd.leases ?

    Something is going wrong sucking all the lines into an array $leases_contents


  • The file sizes are small:

    1,368,718 bytes on the backup (problematic) node and 142,814 on master.

    The size difference between nodes is worrying…

    Would you suggest deleting the file on backup, starting DHCP on backup  and allowing full DHCP CARP resync from master?


  • Certainly the size on the backup is too big.
    Not being at all knowledgeable about CARP, I will let someone else give you advice on how to fix it - obviously the one on the backup needs to become the same as the master  :P


  • Deleting  /var/dhcpd/var/db/dhcpd.leases has done the trick.

    It also fixed the problem of some of the DHCP assigned hosts not resolving in DNS.

    No both notes happily run DHCP and all DNS is resolving.


  • Yeah deleting the leases file there is fine. I was curious how it got to be so big, but guess it's too late to ask that now. :)

    What you describe there is a bug caused by ISC dhcpd not syncing the hostname as a part of leases to its peers. So each host only knows about the hostnames for which it issued the lease. We have an open bug ticket on it.
    https://redmine.pfsense.org/issues/4061

  • Banned

    @cmb:

    Yeah deleting the leases file there is fine. I was curious how it got to be so big, but guess it's too late to ask that now. :)

    Hmmm… could be bigger I guess? Found a ~23MB dhcpd6.leases file here on a full install. (About a year old, DHCPv6 not used any more on that box.)