MyBB Community Forums

Full Version: [B] Rebuild Thread Counters - thread cache grows above memory limit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
MyBB 1.4.4
Rebuilding Thread Counters with large Entries per page (e.g > 5000; with overall threads above 100000) fails with "Allowed memory size of 64 MB exhausted".

Memory usage grows because of static $thread_cache in get_thread() which holds every thread. This is not necessary - we do not have to cache every thread... So maybe limit the size of $thread_cache?

Proof of concept with hard limit (solves the issue, but there can be more elegant solutions) in patch.
This also happens with attachment rebuilding.
How about just limit of the size of your per page? This seems bogus because your the one forcing it to process so many at one time, not us
Good luck with recounting 130 000 threads with 500 per page... and 130 000 is not a big number - there are bigger boards...
We have the defaults between 100 and 200 for a reason. That would be not a bug, but your server unable to handle that much at the same time.
(2009-01-28, 03:29 PM)koziolek Wrote: [ -> ]Good luck with recounting 130 000 threads with 500 per page... and 130 000 is not a big number - there are bigger boards...

Yep. And those bigger boards have been correctly configured. I should know, since I help run one of them. In fact it is approximately 30 times bigger then yours and recount and rebuilds run smooth and fast.

You need to configure your server correctly if you want to do more then MyBB's default values for recounting.
Can the recounting process at least be automated, rather than having to click on a button every time?
(2009-01-28, 11:56 PM)bobbit Wrote: [ -> ]Can the recounting process at least be automated, rather than having to click on a button every time?

That's a good idea. Can you post it on the suggestions forum or the ideas site?
Done.

Also added a little something else in but it's not necessary.
(2009-01-28, 09:44 PM)Ryan Gordon Wrote: [ -> ]You need to configure your server correctly if you want to do more then MyBB's default values for recounting.
First: By configuring server correctly you mean raising up memory_limit? Heh... The memory usage of any script should not raise above some level. No matter what value the user passes to a script. App should still behave correctly with proper memory footprint. User can set "10000 entries per page" and the application can timeout (max execution time) but it cannot eat MB of memory. As I said once here - lazy and bad programming cannot be an excuse for buying more memory...

Second: Anyway, it is a hosting.
Pages: 1 2