Fixed Outrageous Memory Usage for Resources with Many Watchers

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....
 
What error do you get specifically?

I would suggest that is effectively the same issue (which probably applies to threads as well).
 
What error do you get specifically?

I would suggest that is effectively the same issue (which probably applies to threads as well).
The XenForo error log stack trace was useless, only two deep (just ::handleException)
 
That may be true, but what was the error specifically?
Code:
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)
 
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.
 
Top Bottom