[OJS 3.2.1.2] Memory Exhaustion on "Submissions" Backendpanel after Update

Hello everybody,

I am currently testing the upgrade from OJS 3.1.1.2 to 3.2.1.2 inside a docker environment in preparation for the real upgrade on our main OJS instance.

Did a full package upgrade and DB upgrade via CLI - both of them finished without any errors (apart from some minor fixes for our custom template), but now i am unable to access the (backend) submissions section or anything related to that, because OJS seems to eat up memory in giant chunks.

PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php on line 425
php-fpm_1     | 172.26.0.6 -  03/Dec/2020:14:48:00 +0000 "GET /html/index.php" 500

The environment is a LAMP stack with PHP 7.3.13, Apache 2.4.29, MySQL 5.7.30 and i have tried different memory_limit configuration (up to 2GB), but to no avail. So i guess, there is some kind of infinite loop or memory leak.

Judging by the error, it is something related to the templating engine.
Any recommendations to remedy that issue?

Hi @mlfct,

Hmm, that’s unusual – I haven’t seen that behaviour before, and OJS 3.2.1-2 is pretty widely deployed. Are you using any custom/unusual plugins?

I think you might be able to get a more detailed error dump by turning on the show_stacktrace option in config.inc.php, though I’m not sure it’ll apply to that particular failure mode.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
Thank you for the followup.

I did some additional research in the meantime and i think i might have solved it. So there was another error, that was related to the docker configuration.

php-fpm_1     | NOTICE: PHP message: PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 262144 bytes) in /var/www/html/lib/pkp/classes/session/SessionManager.inc.php on line 184
php-fpm_1     | NOTICE: PHP message: PHP Warning:  Unknown: Cannot call session save handler in a recursive manner in Unknown on line 0
php-fpm_1     | NOTICE: PHP message: PHP Warning:  Unknown: Failed to write session data using user defined save handler. (session.save_path: /tmp) in Unknown on line 0

Somehow the default shared /tmp folder inside Docker on OSX interferred with the container’s internal /tmp. Removing the folder share from the Docker settings resolved that issue.

PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php on line 425

After digging through all the compiled backend templates, i noticed, that our frontend theme was actually overwriting the backend footer. (via THEME_FOLDER/templates/common/footer.tpl) After removing the corresponding theme template file, the backend memory issues were gone.

Don’t know, if there’s still an option to edit/hook the backend footer, but it is working now (and the edit was non-essential/cosmetic anyway).

Thanks!

1 Like