MDL-13237 rceche limiting through intcachemax finally implemented - this should prevent major memory leaks; backported from MOODLE_19_STABLE
This commit is contained in:
@@ -2324,6 +2324,12 @@ function rcache_set($table, $id, $rec) {
|
||||
global $CFG, $MCACHE, $rcache;
|
||||
|
||||
if ($CFG->cachetype === 'internal') {
|
||||
if (!isset($rcache->data[$table])) {
|
||||
$rcache->data[$table] = array();
|
||||
}
|
||||
if (!isset($rcache->data[$table][$id]) and count($rcache->data[$table]) > $CFG->intcachemax) {
|
||||
array_shift($rcache->data[$table]);
|
||||
}
|
||||
$rcache->data[$table][$id] = clone($rec);
|
||||
} else {
|
||||
$key = $table . '|' . $id;
|
||||
|
||||
Reference in New Issue
Block a user