Flushing all the caches causes a fatal error

Flushing all the caches causes a fatal error

by Service Usagers du Numérique -
Number of replies: 2

Hi,

Since few days, we can no more flush the cache of our platform (Admin site > development > Flushing all caches). Each time, this operation causes a fatal error like this one :

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 67108872 bytes) in xxxx/cache/stores/file/lib.php on line 546

I've tried to raise the value of the memory_limit parameter in php.ini (up to 0 value which allowed illimited memory allocation - up to 32 GB) but each time, the operation stops and requires more and more memory  sad

The platform is hosted on a Centos Linux Server (version 7.6.1810 - kernel version 3.10.0-957.10.1.el7.x86_64), with PHP 7.0.27 (installed with software collection tools), apache 2.4.34.

This operations worked on the near past and I don't know why it don't succeed today sad (an update of the kernel, of the OS, of PHP, ... I don't know ???). 

In hope of your help or your advices ...

Thank you by advance.

O.L.


Average of ratings: -
In reply to Service Usagers du Numérique

Re: Flushing all the caches causes a fatal error

by Ken Task -
Picture of Particularly helpful Moodlers

How much memory does server have?   What's using memory?

What version of Moodle?

In 3.4 and 3.5 Admin -> Development -> Purge Caches has only one button ... Purge All.

In 3.6 Admin -> Development -> Purge Caches there is Purge Selected caches.

Options are:
Themes, Language Strings, Javascript, Text Filters, All MUC caches, All file ane miscellaneous caches

There is also a cli only script in moodlecode/admin/cli/ purge_caches.php that takes apache out of the loop.   No options ... just does it.

While the GUI might not work, one can manually remove contents of moodledata/cache/ moodledata/localcache/  from cli and Moodle will repopulate slowly.

'spirit of sharing', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Flushing all the caches causes a fatal error

by Service Usagers du Numérique -

Hi Ken,

We are under Moodle 3.1.13 (Development -> Purge Caches > Purge All). We are currently thinking of migrating this platform to 3.5 version  but it is not so simple ... (because of its size and permanent usage).

Server has 32 GB memory. If I tune php with unlimited memory (cf memory_limit parameter to 0), fatal error also occured ... I think this is a memory leak problem which is probably recent, perhaps because of a recent update of the system packages (kernel or php core).

Thank you for your tips and workaround solutions smile I will try them as soon as possible.

Cordially,

O.L. (Newbie in Moodle administration)