Allowed memory size exhausted
Posted
#3324
(In Topic #650)
I'm getting frequent "Critical Errors" on my site with the error being the "Allowed memory size of XXXXXXX bytes exhausted (tried to allocate XXXXXX bytes) in sources/caches3.php on line 331."
I've increased the php_memory limit and added additional swap memory for the site but these don't seem to resolve the issue. I end up having to flush the cache to alleviate the error, but I don't want to have to mannual do that every time the error pops up. Is there some setting I'm missing that is causing this issue?
Posted
Posted
Posted
25-Oct-2017 08:37:31 UTC PHP Error Allowed memory size of 67108864 bytes exhausted (tried to allocate 343467 bytes) in sources/caches3.php on line 331
The latest place that it has been encountered by users when they try to access the form to join the site. The "Critical Error" page appears rather than the join form.
Posted
I may need to look directly on the server to run tests. If you are able to provide that access (E.g. FTP details), please e-mail to chris@ocproducts.com.
Regardless, I will see if I can see any memory bottlenecks on this page.
Posted
I suspect you may have placed some large files in one of the template directories.
Check you haven't accidentally uploaded alien files to any of these directories:
themes/*/css
themes/*/css_custom
themes/*/javascript
themes/*/javascript_custom
themes/*/templates
themes/*/templates_custom
themes/*/text
themes/*/text_custom
themes/*/xml
themes/*/xml_custom
The error message suggests a file at least 300kb in size, which is unlikely for a template file, but I suspect you have a lot of alien files in there.
Posted
Code
8 xml_custom
40 text_custom
144 xml
176 text
216 css_custom
888 javascript_custom
1184 css
1352 templates_custom
4584 javascript
8056 templates
Posted
https://raw.githubusercontent.com/ocproducts/composr/f79e2e8b9893e6ffbdca2b4e7a35451ce5521fa0/sources/caches3.php
That will probably fix the issue for you also.
More detail:
When certain automatic cache flushes happen it limits cache flushing of templates based on ones matching certain patterns only within their data. To do this it has to read all the templates. If there's alien files in there it is reading in all that data unnecessarily. The hotfix will target what files it will read.
Posted
Posted
2 guests and 0 members have recently viewed this.
