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

Backup: backup_includes_files can leak memory

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.6
    • Component/s: Backup
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-41146-master

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  18/Nov/13