Answers.Body: <p>This is fixed. @brad-bell helped me to understand that the problem was likely being caused by custom module code - he was able to import our database, install composer packages, and then update to the latest Craft version. The big difference between his process and ours was that he didn't have our custom module code.</p>
  <p>I was able to find the cause by removing all of our modules from autoload and then adding them back one by one.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-29T17:29:17.507Z
Answers.LastActivityDate: 2021-06-29T17:29:17.507Z
Answers.UserDisplayName: plaintxt
Body: <p>I'm stepping through Craft release versions while updating a Craft v3 site that is many versions behind. 3.5.7 works fine, but after using <code>$ composer require craftcms/cms:3.5.8</code>  to update to 3.5.8, loading the CP resolves in an error:</p>
  <pre><code>PHP Fatal Error – yii\base\ErrorException
  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes)
  </code></pre>
  <p>I've poked through the various posts that talk about this type of error and have tried a few things without success.</p>
  <ul>
  <li>updated memory_limit to 512MB (even tried setting memory_limit = -1, still didn't work)</li>
  <li>updated max_execution_time to 120</li>
  <li>set <code>enableTemplateCaching</code> to false (@brad-bell suggested setting <code>cacheElementQueries</code> to false in <a href="https://craftcms.stackexchange.com/a/26923">this post</a>, but I think that setting's been deprecated)</li>
  <li>ran garbage collection</li>
  <li>confirmed that craft_templatecacheelements, craft_templatecachequeries, and craft_templatecaches are all empty (0 rows)</li>
  <li>commented out all of the <code>{% cache %}</code> tags in our templates</li>
  <li>as a last-ditch effort, I moved all of our templates out of the <code>templates</code> directory- made no difference</li>
  </ul>
  <p>I'm at a real impasse. The db itself is 395.2MB and contains 244 tables.</p>
  <p>Our goal is to get Craft up to date in the hopes that it'll fix a Sprout Forms Pro issue that we're experiencing.</p>
  
Tags: <craft3><plugin-sproutforms><memory>
Title: Upgrade to 3.5.8 causing Allowed memory size bytes exhausted error
ThreadText: # Upgrade to 3.5.8 causing Allowed memory size bytes exhausted error
  
  (Asked by: username_0 on 2021-06-25)
  
  I'm stepping through Craft release versions while updating a Craft v3 site that is many versions behind. 3.5.7 works fine, but after using `$ composer require craftcms/cms:3.5.8` to update to 3.5.8, loading the CP resolves in an error:
  
  ```
  PHP Fatal Error – yii\base\ErrorException
  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes)
  
  ```
  
  I've poked through the various posts that talk about this type of error and have tried a few things without success.
  
  * updated memory\_limit to 512MB (even tried setting memory\_limit = -1, still didn't work)
  * updated max\_execution\_time to 120
  * set `enableTemplateCaching` to false (@brad-bell suggested setting `cacheElementQueries` to false in [this post](https://craftcms.stackexchange.com/a/26923), but I think that setting's been deprecated)
  * ran garbage collection
  * confirmed that craft\_templatecacheelements, craft\_templatecachequeries, and craft\_templatecaches are all empty (0 rows)
  * commented out all of the `{% cache %}` tags in our templates
  * as a last-ditch effort, I moved all of our templates out of the `templates` directory- made no difference
  
  I'm at a real impasse. The db itself is 395.2MB and contains 244 tables.
  
  Our goal is to get Craft up to date in the hopes that it'll fix a Sprout Forms Pro issue that we're experiencing.
  
  **Tags:** craft3, plugin-sproutforms, memory
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-06-29. Score: 2
  
  This is fixed. @brad-bell helped me to understand that the problem was likely being caused by custom module code - he was able to import our database, install composer packages, and then update to the latest Craft version. The big difference between his process and ours was that he didn't have our custom module code.
  
  I was able to find the cause by removing all of our modules from autoload and then adding them back one by one.
  
  
  ---
  
  