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

Allowed memory error when creating new style

Discussion in 'Troubleshooting and Problems' started by Vilandra, Jan 16, 2011.

  1. Vilandra

    Vilandra Active Member

    When I try to add a new style, I'm getting these errors:

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 131072 bytes) in /library/XenForo/Application.php on line 886

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 72 bytes) in /library/XenForo/Template/Compiler.php on line 1465

  2. Mike

    Mike XenForo Developer Staff Member

    Are you running in debug mode? Your server seems to limited the ability to change the memory_limit, and debug mode uses a lot more memory.

    Also, how many styles do you have?
  3. Vilandra

    Vilandra Active Member

    Nope, not running in debug mode (unless there's some way for it to happen without me adding it to config.php).

    I have 14 styles right now.
  4. Vilandra

    Vilandra Active Member

    So, I found out from my host how to increase memory_limit - but is adding a style supposed to use so much memory?

  5. Mike

    Mike XenForo Developer Staff Member

    Possibly not that much - unfortunately memory errors are a nightmare to track down. That said, 14 styles is really far from the norm, so it's a serious edge case. I'll try to improve the memory usage.
  6. Vilandra

    Vilandra Active Member

    Is having a lot of styles going to be a problem on XF? My other site has more like 60 or 70 styles, and it would be better to know that before I start switching it over...lol...

    Thanks :)
  7. Mike

    Mike XenForo Developer Staff Member

    That is going to cause a sizable overhead at the least - there isn't really a hard and fast limit though.
  8. Vilandra

    Vilandra Active Member

    I don't mean this in a jerky way, I honestly want to know the answer lol - why do the cache's need to be rebuilt every time an addon is installed or a style is added?

  9. Mike

    Mike XenForo Developer Staff Member

    New phrases, new templates, new includes. All sorts of stuff really.
  10. TerminalAddict

    TerminalAddict Active Member

    I bet a weeks salary (nah maybe not) that the host is using php-cgi or fastcgi.

    both of which load the running processes of php into memory (which is normal) but this memory allocation is counted when php configs at run time.
    so if you have a 32m allocation (seems like a common number used) php might be using 16m or more with out loading any of the data in to the process.

    it sucks, but there is no alternative if you have limited memory, mod-php is way too insecure for a webhost, and chroot apache is too complex.

    The only way to fix it is to talk to your webhost and ask them to increase memory, or move to a host that doesn't allocate memory (which is becoming increasingly more popular)
  11. Vilandra

    Vilandra Active Member

    Thanks Mike and thanks TerminalAddict :) Both really helpful info :)

Share This Page