Ad Widget

Collapse

Allowed memory size exhausted

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #1

    Allowed memory size exhausted

    this is about the famous memory exhaustion, which in all cases i could find was "solved" by increasing memory limit for a php script. but there are some things that trouble me with this solution...

    so, the error usually goes like :
    PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 2913 bytes) in /srv/www/htdocs/zabbix/include/config.inc.php on line 2643, referer: http://10.196.5.215/zabbix/charts.php

    now, memory limit is 8mb. what could be requiring that much memory for a script ?
    this problem usually appears with graphs and, as can be seen from the log entry, that's also the case in here.
    weird things :

    1. in any case, should a graph generator indeed require more than 8 megs ?
    2. this problem only appears for some graphs and not for others;
    3. the graphs that this problem appear for show perfectly in screens (together with other 4 graphs - i asuume this should take more memory);
    4. i have two machines - x86 and x86_64 - with identical configuration and software (except the arch). on x86 machine these graphs work flawlessly (also 8mb limit), on x86_64 machine they break;
    5. it has been mentiond that very large periods can cause memory exhaustion. on x86 machine i was able to generate monthly & yearly graphs without any problems (and screens with weekly & monthly graphs), but on x86_64 the graphs fail even for 1 hour period.

    this is using apache 2.2.0 and 5.1.2.

    it seems to be some problem with either zabbix frontend or php or something - but what exactly ? maybe there are some tests that could be performed to find out more ?
    Zabbix 3.0 Network Monitoring book
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    PHP internally keeps images in raw format, it requires lot of memory especially for high-resolution images. I don't know why there is a difference between 32/64 bits, I'm pretty sure it is something PHP specific.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • jbothe
      Junior Member
      • Sep 2006
      • 10

      #3
      Personally I've changed my memory_limit to 32M and max_execution_time to 90 (default was 30 seconds). I found when viewing larger graphs the memory_limit would very quickly become exhausted. In the case of the execution_time, its takes a bit of time to import 500 servers.

      Comment

      Working...