View Issue Details

IDProjectCategoryView StatusLast Update
5254Composr alpha bug reportsGeneral / Uncategorisedpublic2023-02-10 16:36
ReporterPDStig Assigned ToChris Graham  
PrioritynormalSeverityminor 
Status resolvedResolutionfixed 
Summary5254: PHP memory issues via comcode_renderer.php
Description[23-Jan-2023 17:49:47 UTC] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 761856 bytes) in /home/patricks/git/composr/sources/tempcode.php(2041) : eval()'d code on line 1
[23-Jan-2023 17:49:47 UTC] PHP Error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 761856 bytes) in sources/tempcode.php(2041) : eval()'d code on line 1 @ http://localhost/composr/adminzone/index.php?page=admin-stats&keep_devtest=1
[23-Jan-2023 17:49:47 UTC] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 32768 bytes) in /home/patricks/git/composr/sources/comcode_renderer.php on line 2012
[23-Jan-2023 17:49:47 UTC] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 65536 bytes) in Unknown on line 0
Additional InformationRandomly happens on the admin-stats page and the admin dashboard. Note I have static cache on for 180 hours.

Also, Google Analytics is enabled.
TagsNo tags attached.
Attach Tags
Sponsorship open

Sponsor

Date Added Member Amount Sponsored

Activities

Chris Graham

2023-02-10 14:40

administrator   ~7899

Last edited: 2023-02-10 14:40

Tracing memory usage with &cache_blocks=0&keep_show_loading=1 I see:

block: main_staff_checklist (7 MB used, now at 22,872,864)
block: menu (34 MB used, now at 60,744,016)

The issue is prompted by this in the test code:
        // We need to be compatible with low memory limits
        if (memory_get_usage() < 30/*a little give*/ * 1024 * 1024) { // If not already in a high-memory (raised-memory) test set
            @ini_set('memory_limit', '32M');
            set_value('memory_limit', '32M');
        }

Which is cleaned up at the end of the test code:
delete_value('memory_limit');

But if it crashes part way, the lowered setting is left there.

I want us to pass all automated and testing in a 32MB memory limit still, so I will see if I can optimise this.

Chris Graham

2023-02-10 16:35

administrator   ~7900

I've optimised the blocks down successfully...

main_staff_checklist: 4MB
menu: 18MB

Issue History

Date Modified Username Field Change
2023-01-23 19:00 PDStig New Issue
2023-01-23 19:00 PDStig Status Not Assigned => Assigned
2023-01-23 19:00 PDStig Assigned To => Chris Graham
2023-01-23 19:02 PDStig Additional Information Updated
2023-02-10 14:40 Chris Graham Note Added: 0007899
2023-02-10 14:40 Chris Graham Note Edited: 0007899
2023-02-10 16:35 Chris Graham Note Added: 0007900
2023-02-10 16:36 Chris Graham Status Assigned => Resolved
2023-02-10 16:36 Chris Graham Resolution open => fixed
2023-02-26 18:29 Chris Graham Category General => General / Uncategorised