-
Improvement
-
Resolution: Inactive
-
Minor
-
None
-
3.1.13, 3.4.2, 3.5.1
-
None
-
MOODLE_31_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
The function "choice_get_response_data" uses quite a lot of memory as there is duplication of the responses that come back from the DB.
This is an issue for choices where there has been a large amount of responses(10,000+) as it's storing both the raw response and parsed response in memory.
I have posted a quick solution to this, by offsetting the logic to a separate function, ensuring that the response data is not stored in memory longer than it has to be.
Steps to Reproduce:
- Enrol 10,000+ users into a course.
- Answer choice for all 10,000 users(This can be done programmatically on a test site.)
- View a choice via /mod/choice/view.php?id=x
- Depending on your memory limit(ours was 128mb) the page will fail to load.
Commit URL is here: https://github.com/LoneBeta/moodle/commit/4ecf02b3d3a5938b824471e22c6d15ce83056c89