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

Backup: backup_includes_files can leak memory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.6
    • 2.6
    • Backup
    • MOODLE_26_STABLE
    • MOODLE_26_STABLE
    • MDL-41146-master
    • Hide

      NOTE: In order to demonstrate the actual problem you would need to back up a large course, which is not currently possible due to other bugs. While I have tested it that way, for the official testing instructions, I am just suggesting something that goes through the backup logic.

      0. Use a course that contains at least one file for download. (E.g. the 'S' size course generated by MDL-38197.)
      1. Make a backup of the course with default settings.
      2. Restore it as a new course.
      3. Check that the file still downloads from the new course.
      4. Use the 'Duplicate' option on the file in the restored course.
      5. Check that the duplicated file still downloads.

      Show
      NOTE: In order to demonstrate the actual problem you would need to back up a large course, which is not currently possible due to other bugs. While I have tested it that way, for the official testing instructions, I am just suggesting something that goes through the backup logic. 0. Use a course that contains at least one file for download. (E.g. the 'S' size course generated by MDL-38197 .) 1. Make a backup of the course with default settings. 2. Restore it as a new course. 3. Check that the file still downloads from the new course. 4. Use the 'Duplicate' option on the file in the restored course. 5. Check that the duplicated file still downloads.

      The backup_includes_files function is called repeatedly during backup. For a typical backup that contains a large number of files, it could be called many times.

      This function works by loading a backup controller, calling one function in it, and then discarding it.

      This behaviour can cause a memory leak - in my testing, I found that even with 4GB memory limit, it ran out while backing up my 'L' test course - but also seems unnecessary from a performance perspective.

      I am investigating possible solutions and will submit a fix shortly.

            quen Sam Marshall
            quen Sam Marshall
            Mark Nelson Mark Nelson
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Marina Glancy Marina Glancy
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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