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

Logs download (e.g. CSV) uses too much server memory

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a bug
    • Major
    • None
    • 2.7.8, 2.8.6, 2.9
    • Reports
    • None
    • MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE

    Description

      • Pick a course with plenty of users and a few months history
      • Set your php.ini memory_limit to something generous but sensible (I have 512M)
      • Go to the logs report for the course and select everything (works fine, hundreds of pages are expected - the course I had bother with had 1,700 pages)
      • Choose the download as CSV (or any other format) at the bottom of the page
      • Download quickly fails having consumed all the memory (can't allocate x bytes error)

      The code to achieve this seems surprisingly complicated for what it does but I can only assume that the report attempts to load the whole data structure into memory before passing it off to a library function for the actual download. This was never going to work due to the potential for large amounts of log data.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              howardsmiller Howard Miller
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: