I checked the php-fpm log and received the following message:
PHP Fatal error: Allowed memory size of 4294967296 bytes exhausted (tried to allocate 28672 bytes) in /home/....com/public_html/.../includes/cache.inc on line 361
PHP Fatal error: Allowed memory size of 4294967296 bytes exhausted (tried to allocate 262144 bytes) in /home/....com/public_html/.../includes/database/database.inc on line 731
PHP Fatal error: Allowed memory size of 4294967296 bytes exhausted (tried to allocate 16384 bytes) in /home/....com/public_html/.../includes/cache.inc on line 449
PHP Fatal error: Allowed memory size of 4294967296 bytes exhausted (tried to allocate 16384 bytes) in /home/....com/public_html/.../includes/cache.inc on line 449
PHP Fatal error: Allowed memory size of 4294967296 bytes exhausted (tried to allocate 16384 bytes) in /home/....com/public_html/.../includes/cache.inc on line 449
PHP Fatal error: Allowed memory size of 4294967296 bytes exhausted (tried to allocate 20480 bytes) in /home/....com/public_html/.../includes/cache.inc on line 449
PHP Fatal error: Allowed memory size of 4294967296 bytes exhausted (tried to allocate 16384 bytes) in /home/....com/public_html/.../includes/cache.inc on line 449
PHP Fatal error: Allowed memory size of 4294967296 bytes exhausted (tried to allocate 32768 bytes) in /home/....com/public_html/.../includes/database/database.inc on line 2284
# function contains line 361
function getMultiple(&$cids) {
try {
// Garbage collection necessary when enforcing a minimum cache lifetime.
$this->garbageCollection($this->bin);
// When serving cached pages, the overhead of using db_select() was found
// to add around 30% overhead to the request. Since $this->bin is a
// variable, this means the call to db_query() here uses a concatenated
// string. This is highly discouraged under any other circumstances, and
// is used here only due to the performance overhead we would incur
// otherwise. When serving an uncached page, the overhead of using
// db_select() is a much smaller proportion of the request.
$result = db_query('SELECT cid, data, created, expire, serialized FROM {' . db_escape_table($this->bin) . '} WHERE cid IN (:cids)', array(':cids' => $cids));
$cache = array();
// #361
foreach ($result as $item) {
$item = $this->prepareItem($item);
if ($item) {
$cache[$item->cid] = $item;
}
}
$cids = array_diff($cids, array_keys($cache));
return $cache;
}
catch (Exception $e) {
// If the database is never going to be available, cache requests should
// return FALSE in order to allow exception handling to occur.
return array();
}
}
#function contains line 449
protected function prepareItem($cache) {
global $user;
if (!isset($cache->data)) {
return FALSE;
}
// If the cached data is temporary and subject to a per-user minimum
// lifetime, compare the cache entry timestamp with the user session
// cache_expiration timestamp. If the cache entry is too old, ignore it.
if ($cache->expire != CACHE_PERMANENT && variable_get('cache_lifetime', 0) && isset($_SESSION['cache_expiration'][$this->bin]) && $_SESSION['cache_expiration'][$this->bin] > $cache->created) {
// Ignore cache data that is too old and thus not valid for this user.
return FALSE;
}
// If the data is permanent or not subject to a minimum cache lifetime,
// unserialize and return the cached data.
//#449
if ($cache->serialized) {
$cache->data = unserialize($cache->data);
}
return $cache;
}
My current php.ini file is as follows:
PHP version: 7.4.33
PHP memory_limit: 4G
PHP post_max_size: 16M
PHP upload_max_filesize: 4M
PHP max_input_vars: 1000
PHP max_execution_time: 60
And:
OS: Almalinux 9,
webserver: Apache
Drupal version: V 7.101
I tried adjusting the memory_limit parameter in php.ini to 7GB and received the following error message
PHP Fatal error: Allowed memory size of 7516192768 bytes exhausted (tried to allocate 32768 bytes) in /home/.....com/public_html/..../includes/cache.inc on line 361
PHP Fatal error: Allowed memory size of 7516192768 bytes exhausted (tried to allocate 20480 bytes) in /home/.....com/public_html/..../includes/cache.inc on line 449
PHP Fatal error: Allowed memory size of 7516192768 bytes exhausted (tried to allocate 20480 bytes) in /home/.....com/public_html/..../includes/cache.inc on line 449
PHP Fatal error: Allowed memory size of 7516192768 bytes exhausted (tried to allocate 20480 bytes) in /home/.....com/public_html/..../includes/cache.inc on line 449
PHP Fatal error: Allowed memory size of 7516192768 bytes exhausted (tried to allocate 20480 bytes) in /home/.....com/public_html/..../includes/cache.inc on line 449
PHP Fatal error: Allowed memory size of 7516192768 bytes exhausted (tried to allocate 262144 bytes) in /home/.....com/public_html/..../includes/database/database.inc on line 731
I don’t understand where the error comes from, please help me. I tried changing it by setting memory_limit = -1 and my server crashed after 24 hours