I have a Joomla site which has had persistent on-going problems with its cache.
We are able to resolve these problems as they happen by going to the admin panel and clearing the caches, but would obviously prefer if they didn't happen at all. But I am having difficulty trying to debug the problem find out the underlying cause.
The symptoms are that the site operates normally for a period of time, and then suddenly starts giving blank pages with a 500 error. The issue seems to be worse now after a recent upgrade to Joomla 3.8.
I've done some debugging, and the actual crash is an out of memory error. The exact location varies, but the latest example gave me this:
Allowed memory size of 268435456 bytes exhausted (tried to allocate 30548627 bytes) .../libraries/src/Cache/Storage/FileStorage.php:195
This is in the FileStorage::store()
method, trying to add a block of code to the cache.
Looking at the contents of $data
at this point, it is serialized PHP data that contains numerous copies of all the modules on the homepage, and the size of the data is large enough that it pushes us over the memory limit when we try to prepend to it.
There are definitely multiple instances of all the modules, and my guess is that they are building up in the cache over time until it gets too big for the memory limit.
What I don't understand (and can't work out from the debugging I've done) is why this would be happening. By the time the fatal error occurs, it's already way past the point where it's actually built this big structure full of modules, and I don't have the deep knowledge of Joomla's internals to allow me to dig any further.
Can anyone out there give me some pointers as to what might be happening here and how to resolve it permanently?
Thank you.
memory_limit = 256M
, which I feel should be sufficient. Indeed, it is sufficient most of the time.