Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-74750

Mod Assign exhausts memory on busy courses

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 3.11.7
    • Assignment
    • None
    • MOODLE_311_STABLE

      The error is either a server 500 or a "Fatal error: Allowed memory size of XXX bytes exhausted (tried to allocate XXX bytes) in ..." depending on your setup.

      Steps to reproduce:

      1. Set a reasonable memory limit in php.ini
      2. Make a course with an Assign activity
      3. Enroll +130k users into the course
      4. View the Assign activity as a manager

      The issue will happen both on the default view page when constructing the grade summary, and on the "View all submissions" report.

      The culprit is the list_participants() method $this->participants member, and it's uses thereof.  It acquires the full records for each user, processes them in PHP, and stores them in memory for further processing.  In many cases, all that was needed was a count of records, or a list of user IDs.

      130k users might seem like an extreme, but we have a number of real-world use-cases for that scenario.

            Unassigned Unassigned
            cobaltblue David Wipperfurth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.