jcrodriguez-dis / moodle-mod_vpl

Virtual Programming Lab for Moodle (Module)
GNU General Public License v3.0
103 stars 89 forks source link

Memory consumption of submissions list view #154

Closed jojoob closed 1 year ago

jojoob commented 1 year ago

We have a VPL activity with 57 submissions for which 128M memory limit isn't enough to view the submissions list. The list is shown empty and the apache/PHP error.log on the server reports memory exhausted.

image

PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 33554440 bytes) in /var/www/moodle/mod/vpl/vpl_submission.class.php on line 880

This is the place where the over allocation happens: vpl_submission.class.php line 880. The compilation.txt and execution.txt files seem to be quite large.

As a workaround we set memory_limit to 512M via ini_set('memory_limit', '512M'); for this file. But I hope for a fix that lowers the memory usage for this page.

Btw. I can't find the download submission action described here. I only found the download link on submission view page. But the downloaded zip only includes the submitted files and none of the other directories mentioned in the documentation. I wanted to check the compilation.txt and execution.txt files.

We are running 3.5.0+ (2022052312) (commit 43e59a6899e4c7adedc35d3fe9a761ecbe32673f) on Moodle 3.9. This is a bit old but vpl_submission.class.php was not changed significantly since then.

jcrodriguez-dis commented 1 year ago

The commit 37b0d56d4c0ba79b5fbd68d28e6541607c267098, included in VPL 4.2.0, addresses this issue reduding the memory required in the view of the submissions list. For 100 students the memory peek is 12MB + the size of the largest user submision information.