RSS creates Fatal error

Elgg 2.3.13

RSS works fine on all pages except on activity (river) page , which return the following fatal error:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16384 bytes) in ..../vendor/elgg/elgg/engine/classes/Elgg/ViewsService.php on line 367

It points to the below code.

When I increase the size of the memory it works and works and does not stop ....

Please suggest a solution.

Thank you very much.

 

private function renderViewFile($view, array $vars, $viewtype, $issue_missing_notice) {

$file = $this->findViewFile($view, $viewtype);

if (!$file) {

if ($issue_missing_notice) {

$this->logger->log("$viewtype/$view view does not exist.", 'NOTICE');

}

return false;

}


if (pathinfo($file, PATHINFO_EXTENSION) === 'php') {

ob_start();


// don't isolate, scripts use the local $vars

include $file;


return ob_get_clean();

}


return file_get_contents($file);

}