Allowed memory size exhausted



  • I have seen this a few times when I logon to Pfsense:

    Jun 14 11:51:54 	php-fpm 	315 	/diag_edit.php: New alert found: PHP ERROR: Type: 1, File: /usr/local/www/diag_edit.php, Line: 51, Message: Allowed memory size of 536870912 bytes exhausted (tried to allocate 12864340347 bytes)
    Jun 14 11:51:54 	php-fpm 	315 	/diag_edit.php: PHP ERROR: Type: 1, File: /usr/local/www/diag_edit.php, Line: 51, Message: Allowed memory size of 536870912 bytes exhausted (tried to allocate 12864340347 bytes)
    
    Name 	xx.xxxx.xyz
    System 	pfSense
    Serial: 0642QBL00F
    Netgate Device ID: 453b20efc34f66760b06	
    BIOS 	Vendor: Sun Microsystems
    Version: S40_3A21
    Release Date: Thu Oct 30 2008
    Version 	2.4.3-RELEASE-p1 (amd64)
    built on Thu May 10 15:02:52 CDT 2018
    FreeBSD 11.1-RELEASE-p10
    
    The system is on the latest version.
    Version information updated at Tue Jun 26 14:52:27 SAST 2018  
    CPU Type 	Dual-Core AMD Opteron(tm) Processor 1210
    2 CPUs: 1 package(s) x 2 core(s)
    AES-NI CPU Crypto: No
    Kernel PTI 	Disabled
    Uptime 	13 Days 07 Hours 42 Minutes 06 Seconds
    Current date/time 	
    Tue Jun 26 15:15:45 SAST 2018
    DNS server(s) 	
    
        8.8.8.8
        8.8.4.4
    
    Last config change 	Tue Jun 26 15:09:31 SAST 2018
    State table size 	
    0% (333/814000) Show states
    MBUF Usage 	
    0% (2280/507526)
    Load average 	
    0.39, 0.26, 0.26
    CPU usage 	
    12%
    Memory usage 	
    3% of 8147 MiB
    SWAP usage 	
    0% of 16384 MiB
    Disk usage:
         / 	
    55% of 436GiB - ufs
         /var/run 	
    5% of 3.4MiB - ufs in RAM
    

    What would be the cause of this?


  • Netgate

    Looks like trying to edit a file using Diagnostics > Edit File that is too large for php to render.

    Try using the shell and vi or ee instead.



  • No, it's not anyone doing this!! It happens randomly on a regular basis without anyone logging in. The logs show no logon...


  • Netgate

    The log entry was from 12 days ago. Maybe someone did it back then?


  • Rebel Alliance Developer Netgate

    @lifeboy said in Allowed memory size exhausted:

    No, it's not anyone doing this!! It happens randomly on a regular basis without anyone logging in. The logs show no logon...

    That cannot be true. The referenced page is only accessible by someone logged into the GUI. If it's not you, then I would make sure the GUI is locked down and change all your passwords at a minimum, or wipe and reload the whole system and reconfigure it from scratch.

    It probably is you, however, but it's an old log message as @Derelict mentioned, in which case it's exactly as he described. Editing a file too large for the Diagnostics > Edit page, so clear the notice/crash report and don't try to edit a file that large in the GUI.



  • I'll investigate this a little deeper and analyze the logs to see if anyone else accessed the system. Thanks for your responses so far.



  • I have the same issue, without having anyone logged in i get a crash report. This happens since pfsense updated to 2.4.4-RELEASE (amd64), so it has beend doing this only since a few days now.

    However for me the exact error is:

    Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 12288 bytes) in /usr/local/www/crash_reporter.php on line 100 PHP ERROR: Type: 1, File: /usr/local/www/crash_reporter.php, Line: 100, Message: Allowed memory size of 536870912 bytes exhausted (tried to allocate 12288 bytes) Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 73728 bytes) in /etc/inc/notices.inc on line 436
    

  • Rebel Alliance Developer Netgate

    Hmm, given where that error is, the PHP error log must be massive.

    From Diagnostics > Command, run this in the shell exec box:

    rm -f /tmp/PHP_errors.log
    

    And then reboot and see if the errors return.



  • No showed right away when I logged in. It's not some error that only happend once, .. its one that keep reappearing. Even sends me mails to report it.

    Also before I deleted the file PHP_errors.log I checked the content there was nothing in it. I did however deleted it from ssh but I guess that's all the same.


  • Rebel Alliance Developer Netgate

    Strange that it was empty since line 100 in the crash reporter script is reading only that one file.



  • Probably because I've acknowledged the error?


  • Rebel Alliance Developer Netgate

    Maybe so but you said it keeps reappearing.



  • Rebooted a few times and now the error is gone but it's gotten really slow to almost not workable anymore, the router still works, however the webpages are have gotten really slow to the point where they don't load anymore.