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

PHP memory usage in course/report/log/ is unreasonably large


    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.9.7
    • Fix Version/s: None
    • Component/s: Course
    • Labels:
    • Environment:
      debian lenny, postgresql 8.3.11, php 5.2.6, apache v2.2.9, 32-bit
    • Database:
    • Affected Branches:


      I have a course which the teacher has been looking to get logs from. It has about 30,000 log entries.

      When he goes to download logs for all days into a CSV, XLS, etc. he gets a blank page. It turns out that this is because the script is exceeding the PHP memory limit. The memory limit is set at 96MB which is pretty large. More than 27700 records causes this report to fail. If I up the PHP memory limit to 128MB I can get the full list.

      While I don't get a log report, I can look at htop, sorted by memory and see a transient apache process go up to above 1% of memory which seems to be it, 1% of memory is about 80MB.

      What's odd is that when you get the full report, it's only 2.3MB on disk. I can appreciate that the objects could be somewhat larger in RAM, but there surely must be something wrong if it's exceeding 96MB.

      Is the object being copied around the place ad nauseum. Might a bit of pass by reference help here?

        Gliffy Diagrams




              • Votes:
                0 Vote for this issue
                2 Start watching this issue


                • Created: