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

Outrageous Memory Usage for Resources with Many Watchers

Discussion in 'Resource Manager Bug Reports' started by md_5, Jul 10, 2016.

  1. md_5

    md_5 Well-Known Member

    Similar to https://xenforo.com/community/threads/unable-to-moderate-downloads-with-many-subscribers.69640/ but not quite.

    We have a few very popular resources, including the largest one which currently has 28,416 watchers. Unfortunately whenever the author tries to post an update to this resource, he causes PHP to run out of memory.

    Originally a memory limit of 128M was fine to run XenForo. It is currently 384M and I am now about to increase it to 512M in the hopes that I can keep the issue at bay for a few months until a fix is released....
    Xon, jflory7 and ncbetz like this.
  2. Mike

    Mike XenForo Developer Staff Member

    What error do you get specifically?

    I would suggest that is effectively the same issue (which probably applies to threads as well).
  3. md_5

    md_5 Well-Known Member

    The XenForo error log stack trace was useless, only two deep (just ::handleException)
  4. Chris D

    Chris D XenForo Developer Staff Member

    That may be true, but what was the error specifically?
  5. md_5

    md_5 Well-Known Member

    ErrorException: Fatal Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 18906272 bytes) - library/Zend/Db/Statement/Mysqli.php:250
    Generated By: md_5, A moment ago
    Stack Trace
    #0 [internal function]: XenForo_Application::handleFatalError()
    #1 {main}

    As I said, useless.

    Had to go and bump down the memory limit to trigger it (was 512M)
  6. Slind

    Slind Active Member

    We ran into this or a similar issue with subscribed forums, the only we can create threads in those areas is by creating them somewhere else and moving them afterwards.
    Xon likes this.
  7. Xon

    Xon Well-Known Member

    This is a design flaw where the entire user record (and options, and preferences) is loaded for every user who has watched something.

    I believe XenForo can dramatically limit the size of the data by removing a bunch of "<table>.*" from the queries to only fetch just the required data. Ideally there would be a hook to inject additional select clauses for add-ons.

    The other (better)alternative is to push the notification stuff into a deferred task which alerts users in chunks.
    i9hdkill, eva2000, Liam W and 3 others like this.
  8. Liam W

    Liam W Well-Known Member

    I think a deferred task would be much better. It's sorta what that system was designed for (in my opinion, at least. I'm not privy to XenForo ideas.).

    eva2000 and Slind like this.

Share This Page