8.5.5 - Allowed memory size exhausted

I’m new to Concrete, coming from a Wordpress design/development background. Our setup is odd to me, as I pointed out in another thread, but shouldn’t be causing this issue: each section of the site is a unique Concrete install and we use symlinks to point to the core Concrete files.

Anyway, we have a lot of memory size exhausted errors in our php logs and I could use some help figuring out where to start fixing. We upped the PHP memory_limit from 128M to 256M and it didn’t help. We upped it to 512M and it didn’t help – and the server crashed overnight. Not sure if it’s related. But today I bumped it back down to 256M. What should this be set at to run Concrete? We have some relatively large jpg images (2400x1600) but nothing extreme.

Below is a sample of the errors we get. In the university_theme header.php file, line 366 is just if($c->getCollectionID() == 1) {

  <?php if($c->getCollectionID() == 1) { ?>
              <h1 id="main-page-title"><?php echo Config::get('concrete.site'); ?></h1>
            <?php } else { ?>
              <h1 id="main-page-title"><?php echo $c->getCollectionName(); ?></h1>
            <?php } ?>
          <?php } ?>

Not sure if that’s the cause of the problem, or just where it starts running out of memory. Any pointers on where to start with troubleshooting this are greatly appreciated!

[14-Jan-2022 09:22:04 America/Chicago] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 131072 bytes) in /var/www/core/packages/mississippi_college/themes/university_theme/elements/header.php on line 366
[14-Jan-2022 09:22:04 America/Chicago] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/core/core/8.5.5/concrete/vendor/symfony/http-foundation/Response.php on line 1283
[14-Jan-2022 09:22:04 America/Chicago] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 90112 bytes) in Unknown on line 0
[14-Jan-2022 09:22:57 America/Chicago] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 135168 bytes) in /var/www/core/core/8.5.5/concrete/src/Html/Service/Seo.php on line 40
[14-Jan-2022 09:22:57 America/Chicago] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/core/core/8.5.5/concrete/vendor/symfony/http-foundation/Response.php on line 1283
[14-Jan-2022 09:22:57 America/Chicago] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 102400 bytes) in Unknown on line 0
[14-Jan-2022 09:23:43 America/Chicago] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 131072 bytes) in /var/www/core/packages/mississippi_college/themes/university_theme/elements/header.php on line 366
[14-Jan-2022 09:23:43 America/Chicago] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/core/core/8.5.5/concrete/vendor/symfony/http-foundation/Response.php on line 1283
[14-Jan-2022 09:23:43 America/Chicago] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 94208 bytes) in Unknown on line 0
[14-Jan-2022 09:24:35 America/Chicago] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 131072 bytes) in /var/www/core/packages/mississippi_college/themes/university_theme/elements/header.php on line 366
[14-Jan-2022 09:24:35 America/Chicago] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/core/core/8.5.5/concrete/vendor/symfony/http-foundation/Response.php on line 1283
[14-Jan-2022 09:24:35 America/Chicago] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 94208 bytes) in Unknown on line 0
[14-Jan-2022 09:25:25 America/Chicago] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 131072 bytes) in /var/www/core/packages/mississippi_college/themes/university_theme/elements/header.php on line 366
[14-Jan-2022 09:25:25 America/Chicago] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/core/core/8.5.5/concrete/vendor/symfony/http-foundation/Response.php on line 1283
[14-Jan-2022 09:25:25 America/Chicago] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 94208 bytes) in Unknown on line 0

From the looks of the code you posted it appears to have an extra closing curly bracket, possible it is surplus or maybe it is closing an open curly bracket from further up the page?

Closing one from further up the page. The whole code block is:

<?php if(!$c->getAttribute('header_logo')) { ?>
            <?php if(($c->getPageTemplateHandle() != 'landing') && ($c->getCollectionID() != 1)) { ?>
              <span class="parent-site out"><a href="<?php echo View::URL('/'); ?>"><?php echo Config::get('concrete.site'); ?></a></span>
            <?php } ?>
            <?php if($c->getCollectionID() == 1) { ?>
              <h1 id="main-page-title"><?php echo Config::get('concrete.site'); ?></h1>
            <?php } else { ?>
              <h1 id="main-page-title"><?php echo $c->getCollectionName(); ?></h1>
            <?php } ?>
          <?php } ?>