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

when regarding quizzes with lots of attempts, php runs out of memory

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.5, 2.2.2
    • Fix Version/s: 2.1.6, 2.2.3
    • Component/s: Questions, Quiz
    • Labels:
    • Testing Instructions:
      Hide

      It is difficult to reproduce this, if you do not have the right (amount of) data.

      Paul Johnson was finding that it ran out of memory with about 100 attempts, with our default memory limit of 128MB.)

      1) Create a quiz,
      2) add a couple of questions to the quiz.
      3) attempt the quiz as student(s)
      4) as admin, under Navigation->yourquiz->Results->Grades, click on "Regarde all" or "Dryrun a full regrade" (let it show all attempts).
      In terms of memory leak consider the following:
      When memory limit = 128MB, it fails at about 100 attempts.

      (The other way to test this is to add print_object(memory_get_usage()); inside regrade_attempt(), and check that the memory usage stays about constant, rather than increasing linearly.)

      Show
      It is difficult to reproduce this, if you do not have the right (amount of) data. Paul Johnson was finding that it ran out of memory with about 100 attempts, with our default memory limit of 128MB.) 1) Create a quiz, 2) add a couple of questions to the quiz. 3) attempt the quiz as student(s) 4) as admin, under Navigation->yourquiz->Results->Grades, click on "Regarde all" or "Dryrun a full regrade" (let it show all attempts). In terms of memory leak consider the following: When memory limit = 128MB, it fails at about 100 attempts. (The other way to test this is to add print_object(memory_get_usage()); inside regrade_attempt(), and check that the memory usage stays about constant, rather than increasing linearly.)
    • Workaround:
      Hide

      At the end of the method regarde_attemp(), setting chuncky objects to NULL and using
      gc_collect_cycles() to force collection of any existing garbage cycles.

      Thanks to Tim.

      Show
      At the end of the method regarde_attemp(), setting chuncky objects to NULL and using gc_collect_cycles() to force collection of any existing garbage cycles. Thanks to Tim.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:

      Description

      when regarding quizzes with lots of attempts, php runs out of memory and does not finish "Regarde all" or "Dry run a full regarde" and cuases an error like "HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfil the request."

      PHP.log however, indicates a memory leak

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/May/12