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

Moodle 3.11 upgrade runs out of memory on large system

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.11.2
    • Fix Version/s: None
    • Labels:
      None
    • Affected Branches:
      MOODLE_311_STABLE

      Description

      The function user_profile_social_update_module_availability is called from an upgrade step. This includes this line:

      $modules = $DB->get_records('course_modules');

      If you have a large number of entries in the course_modules table, this is likely to use all your memory because:

      • It loads all the records even though it only needs the ones with availability field set
      • It reads all the records into memory at once (should use get_recordset which loads them in batches of 100,000 or so)
      • It loads all the fields of the records even though it actually only needs the id and availability fields

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              quen Sam Marshall
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Matteo Scaramuccia, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: