1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.3 ErrorException: Fatal Error: Out of memory (allocated 65798144) (tried to allocate 4194304 bytes)

Discussion in 'XenForo Questions and Support' started by Hornstar, May 7, 2014.

  1. Hornstar

    Hornstar Well-Known Member

    I just saw this error come in my server log.

    Code:
    ErrorException: Fatal Error: Out of memory (allocated 65798144) (tried to allocate 4194304 bytes) - library/XenForo/Link.php:771
    Generated By: Unknown Account, Today at 1:03 PM
    Stack Trace
    #0 [internal function]: XenForo_Application::handleFatalError()
    #1 {main}
    Request State
    array(3) {
    ["url"] => string(46) "http://www.***.net/forums/deferred.php"
    ["_GET"] => array(0) {
    }
    ["_POST"] => array(3) {
    ["_xfRequestUri"] => string(33) "/forums/members/kikomania.140685/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
    }
    }
    
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    That's a very low memory_limit. Is there anything you can do to get that raised higher?
     
    Hornstar likes this.
  3. Hornstar

    Hornstar Well-Known Member

    Just to make sure I do it right. Do I:
    1. edit the php.ini
    2. Change memory_limit = 2128M
    3. What would you change it to? It's currently on 212.
    4. I am on litespeed. Do I restart liftespeed webserver when I am done?

    ps. I have a feeling I am editing the wrong php.ini as it is saying it is set to 212 yet the error said it tried to allocate a different amount. How can I be sure?
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    If the limit is currently that, then that's obviously considerably less than the limit suggested by the error message.

    I believe there is a similar config in Litespeed that overrides PHP's memory_limit. As per the error it is overriding it as low as 64M. Find the limit in Litespeed and set it to the same as the value in php.ini.
     
    Hornstar likes this.
  5. Tracy Perry

    Tracy Perry Well-Known Member

    Normally for it to take effect (at least on OLS) you do have to do a graceful restart. And (again on OLS) the php.ini it uses is in /usr/local/lsws/lsphp5/lib.
    I'm in the process of upgrading all my sites to OLS 1.3.1 and their are either compiles of OLS going on or upgrading php, but as soon as one of them is done I'll see if I can find where that setting that @Chris D refers to is.

    EDIT:
    I believe this is the area that you can set it at.
    Screen Shot 2014-05-07 at 11.30.18 AM.png
     
    SneakyDave and Hornstar like this.
  6. Hornstar

    Hornstar Well-Known Member

    Thanks. Which one in particular? Is it the memory hard or soft limit one? What have you set yours to?
     
  7. Chris D

    Chris D XenForo Developer Staff Member

    You should set both of them to the same as your PHP limit.
     
    Hornstar likes this.
  8. Tracy Perry

    Tracy Perry Well-Known Member

    That's (what is shown) is what I have mine set to.
     
    Hornstar likes this.
  9. Hornstar

    Hornstar Well-Known Member

    Thanks!
     
  10. Hornstar

    Hornstar Well-Known Member

    Actually I was just thinking @Chris D you said something was overriding it at 64M however in litespeed where @Tracy Perry showed me to update it for the soft and hard memory limit. Mine was set at 300M and 600M, which I have now changed to 2064M however if something was limiting it to 64M then it would have to be something else right?
     
  11. Tracy Perry

    Tracy Perry Well-Known Member

    Yep, either your php.ini setting or possibly a config.php setting.
    Have you done a custom compile of PHP or are you running with what it installed?
     
  12. Hornstar

    Hornstar Well-Known Member

    My host did the install, but I am fairly sure it was default. My php.ini is set to 2064M and I also checked my phpinfo.php file and it came back showing it was 2064M

    What config.php file is there with a memory setting in it?
     
  13. Tracy Perry

    Tracy Perry Well-Known Member

    Not by default... but I believe it can be set in there also.... and it's the config file for XenForo.

    There is also the possibility that your server is out of physical memory.

    EDIT:
    Found this post by Mike on something similar
    http://xenforo.com/community/threads/fatal-error-out-of-memory.67458/#post-708690
     
    Hornstar likes this.
  14. Hornstar

    Hornstar Well-Known Member

    Yeah looks like I will have to wait for my host to get back to me. That thread seemed to be a bit of a dead end.
     
  15. lsmichael

    lsmichael Member

    You're not, by any chance, running opcode caching, are you? Your opcode cache counts against the memory limit...
     

Share This Page