From 6ff87b25d4017c5a50e83a64570e1e55b2cb2c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mudr=C3=A1k?= Date: Fri, 16 Sep 2016 12:35:07 +0200 Subject: [PATCH] MDL-55987 gradebook: Claim extra memory when updating final grades As we experienced in a bigger moodle.org course (7500 users, 70 grade items), the standard memory limit 256M may not be enough here. We were not able to find any obvious memory leak in the processing. Requiring extra memory helped in this particular case and it seems reasonable to have it in the core. --- lib/gradelib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/gradelib.php b/lib/gradelib.php index 7f02c836158..d1f3a9a1a5a 100644 --- a/lib/gradelib.php +++ b/lib/gradelib.php @@ -1024,8 +1024,9 @@ function grade_recover_history_grades($userid, $courseid) { * @return bool true if ok, array of errors if problems found. Grade item id => error message */ function grade_regrade_final_grades($courseid, $userid=null, $updated_item=null) { - // This may take a very long time. + // This may take a very long time and extra memory. \core_php_time_limit::raise(); + raise_memory_limit(MEMORY_EXTRA); $course_item = grade_item::fetch_course_item($courseid);