Moodle
  1. Moodle
  2. MDL-23874

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

    Details

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

      Description

      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?

        Activity

        Hide
        Jason Ilicic added a comment -

        It looks like PHP is definitely hitting its memory limit. Once the memory issue is fixed, it then runs into a bunch of SQL errors. I am currently working on a fix for this issue, so might be sorted soon.

        Show
        Jason Ilicic added a comment - It looks like PHP is definitely hitting its memory limit. Once the memory issue is fixed, it then runs into a bunch of SQL errors. I am currently working on a fix for this issue, so might be sorted soon.
        Hide
        Michael de Raadt added a comment -

        Thanks for reporting this issue.

        We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

        If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

        Michael d;

        lqjjLKA0p6

        Show
        Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
        Hide
        Michael de Raadt added a comment -

        I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

        Show
        Michael de Raadt added a comment - I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: