Module listing page leading to php timeout I am noticing that when I open the Modules listing page - admin/modules/ it leads to php timeout.
There was no problem in listing out all the modules with drush. On opening the Modules listing Form in the core.
\Drupal\system\Form\ModulesListForm

I traced the problem to the following loop in the form.
$form['modules']['#tree'] = TRUE;
foreach ($modules as $filename =&gt; $module) {
  if (empty($module-&gt;info['hidden'])) {
    $package = $module-&gt;info['package'];
    $form['modules'][$package][$filename] = $this-&gt;buildRow($modules, $module, $distribution);
    $form['modules'][$package][$filename]['#parents'] = ['modules', $filename];

  }
}

If I do a break; the page loads up correctly with just one module and no errors. I believe its due to the sheer number of modules and the data that needs to be processed before generating the page.
So there is no bug but simply due to the data size in the loop. Has anyone faced this issue before  and know how to speed up things?
P.S I am using the lightning installation profile.
The solution to this was to increase the RAM in the server. We were using a container and the container was very restrictive in the amount of available RAM.