Moodle
  1. Moodle
  2. MDL-30503

Something causes PHP to use up all its memory

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.1.2
    • Fix Version/s: None
    • Component/s: Course completion
    • Labels:
    • Environment:
      Linux moodle 2.6.32-5-amd64 #1 SMP Mon Mar 7 21:35:22 UTC 2011 x86_64 GNU/Linux
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      I really do not know what I can do to help you debug this. I looked at the code, but am not sure how to see what the data values are that is causing the script to just keep eating up memory. Please let me know what I can do to help fix this as it is pretty frustrating for the teacher.

      Show
      I really do not know what I can do to help you debug this. I looked at the code, but am not sure how to see what the data values are that is causing the script to just keep eating up memory. Please let me know what I can do to help fix this as it is pretty frustrating for the teacher.
    • Workaround:
      Hide

      none as I am almost out of memory on the server.

      Show
      none as I am almost out of memory on the server.
    • URL:
      moodle.nsd.org
    • Affected Branches:
      MOODLE_21_STABLE
    • Rank:
      33196

      Description

      I have increased memory from 128MB to 1024MB and still get this error. When I turn on debugging mode I get errors like so:

      Nov 28 14:35:46 moodle apache2: PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 86 bytes) in /opt/app/moodle/lib/completion/data_object.php on line 303
      Nov 28 14:36:01 moodle apache2: PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 74 bytes) in /opt/app/moodle/lib/completion/data_object.php on line 300
      Nov 28 14:36:16 moodle apache2: PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 87 bytes) in /opt/app/moodle/lib/completion/completion_criteria.php on line 151
      Nov 28 14:38:30 moodle apache2: PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 87 bytes) in /opt/app/moodle/lib/completion/completion_criteria.php on line 151
      Nov 28 14:38:51 moodle apache2: PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 74 bytes) in /opt/app/moodle/lib/completion/data_object.php on line 300
      Nov 28 14:39:24 moodle apache2: PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 87 bytes) in /opt/app/moodle/lib/completion/completion_criteria.php on line 151
      Nov 28 14:51:46 moodle apache2: PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 81 bytes) in /opt/app/moodle/lib/completion/data_object.php on line 300
      

      We turned on course completion for the first time and have one teacher who is really using it so I suspect this is what is causing the problem as all other classes and teachers are fine.

      1. bad
        504 kB
        Ski Kacoroski

        Activity

        Hide
        Michael de Raadt added a comment -

        Thanks for reporting that.

        If you find any further information, please be sure to include it.

        Show
        Michael de Raadt added a comment - Thanks for reporting that. If you find any further information, please be sure to include it.
        Hide
        Aaron Barnes added a comment -

        Hi,

        Having a look into this - are you able to tell me how many classes have completion enabled, and how many users are enrolled in theses courses?

        Thanks,
        Aaron

        Show
        Aaron Barnes added a comment - Hi, Having a look into this - are you able to tell me how many classes have completion enabled, and how many users are enrolled in theses courses? Thanks, Aaron
        Hide
        Ski Kacoroski added a comment -

        Aaron,

        Sorry it took so long to get back to you. The best I can tell is that I have 3 courses with course completion enabled adn about 27 - 30 students per course. Of these, one course is the problem child. I just click on its edit settings and apache goes to 100% for about a minute while on the other courses it just takes seconds to return the settings page so it is definitely something about this one course that is breaking. I have attached a trace from the apache process when clicking on the edit settings icon from the course that takes a miniute or so to return the settings page. Perhaps that may help.

        Show
        Ski Kacoroski added a comment - Aaron, Sorry it took so long to get back to you. The best I can tell is that I have 3 courses with course completion enabled adn about 27 - 30 students per course. Of these, one course is the problem child. I just click on its edit settings and apache goes to 100% for about a minute while on the other courses it just takes seconds to return the settings page so it is definitely something about this one course that is breaking. I have attached a trace from the apache process when clicking on the edit settings icon from the course that takes a miniute or so to return the settings page. Perhaps that may help.
        Hide
        Ski Kacoroski added a comment -

        apache process trace file from when I press the edit file settings on a course and it takes about a minute to show the settings. This is the course that has all the problems

        Show
        Ski Kacoroski added a comment - apache process trace file from when I press the edit file settings on a course and it takes about a minute to show the settings. This is the course that has all the problems
        Hide
        Sean Keogh added a comment -

        We are seeing this on just one course in a site that we host - running Moodle 2.2.1+. Disabling completion tracking brings the course back to life. With it enabled, the data_object.php file uses up 768MB of OH memory in about 30 seconds. This course has just eleven participants.

        Show
        Sean Keogh added a comment - We are seeing this on just one course in a site that we host - running Moodle 2.2.1+. Disabling completion tracking brings the course back to life. With it enabled, the data_object.php file uses up 768MB of OH memory in about 30 seconds. This course has just eleven participants.
        Hide
        Sean Keogh added a comment -

        Any progress?

        Show
        Sean Keogh added a comment - Any progress?
        Hide
        Sean Keogh added a comment -

        I can give you access to the site that has the problem if it will help.

        Show
        Sean Keogh added a comment - I can give you access to the site that has the problem if it will help.
        Hide
        Ski Kacoroski added a comment -

        Hi, We are not seeing this bug any more. I am not sure what happened. I suspect the teachers changed some of the data and now we are missing it. I would close it out and if we see it again I will let you know.

        cheers,

        ski

        Show
        Ski Kacoroski added a comment - Hi, We are not seeing this bug any more. I am not sure what happened. I suspect the teachers changed some of the data and now we are missing it. I would close it out and if we see it again I will let you know. cheers, ski
        Hide
        Petr Škoda added a comment -

        thanks, closing

        Show
        Petr Škoda added a comment - thanks, closing
        Hide
        Sean Keogh added a comment -

        Hey, we are still seeing it. I've been waiting for someone to actually do something. I offered access to the site if anyone wanted to see the problem. It is still affecting our client so I'd appreciate someone investigating.

        Sean Keogh

        Show
        Sean Keogh added a comment - Hey, we are still seeing it. I've been waiting for someone to actually do something. I offered access to the site if anyone wanted to see the problem. It is still affecting our client so I'd appreciate someone investigating. Sean Keogh
        Hide
        Petr Škoda added a comment -

        reopening, thanks for the feedback

        Show
        Petr Škoda added a comment - reopening, thanks for the feedback
        Hide
        Aaron Barnes added a comment -

        Hi Sean,

        If you are still looking for someone to have a look at this, feel free to drop me a line at aaronb@catalyst.net.nz and we can arrange access

        Cheers,
        Aaron

        Show
        Aaron Barnes added a comment - Hi Sean, If you are still looking for someone to have a look at this, feel free to drop me a line at aaronb@catalyst.net.nz and we can arrange access Cheers, Aaron
        Hide
        Sean Keogh added a comment -

        Hi Aaron,

        That would be great - email just sent to you.

        Sean K

        Show
        Sean Keogh added a comment - Hi Aaron, That would be great - email just sent to you. Sean K
        Hide
        Aaron Barnes added a comment -

        Hi,

        Sounds like you are having the same issue as http://moodle.org/mod/forum/discuss.php?d=199704

        Still investigating and will let you know when I know more

        Cheers,
        Aaron

        Show
        Aaron Barnes added a comment - Hi, Sounds like you are having the same issue as http://moodle.org/mod/forum/discuss.php?d=199704 Still investigating and will let you know when I know more Cheers, Aaron
        Hide
        Jorge Ramos added a comment -

        Hi! It's happening to us too!! I think that it's something that teachers changed in that resources, this teacher uses a lot of duplication...

        I've delimited the problem to the visibility (hidden works!) of some resources in the course (it only happens in one). If I click in the eye to make visible the activity I get the 'pool memory' error, then I update directly the DB:

        mdl_course_modules -> visible = 1
        mdl_course -> modinfo = null

        Then I refresh the main page of course and it's work ok, and I click in the eye to hide the activity and it works too, but if I click again it crashes...

        The log messages:

        PHP Warning: require_once() [<a href='function.require-once'>function.require-once</a>]: Unable to allocate memory for pool. in /lib/dml/mysqli_native_moodle_database.php on line 31
        PHP Warning: require_once() [<a href='function.require-once'>function.require-once</a>]: Unable to allocate memory for pool. in /lib/dml/mysqli_native_moodle_database.php on line 32
        PHP Warning: require_once() [<a href='function.require-once'>function.require-once</a>]: Unable to allocate memory for pool. in /lib/dml/mysqli_native_moodle_temptables.php on line 31
        PHP Warning: require_once() [<a href='function.require-once'>function.require-once</a>]: Unable to allocate memory for pool. in /lib/setup.php on line 444
        PHP Warning: require_once() [<a href='function.require-once'>function.require-once</a>]: Unable to allocate memory for pool. in /lib/dmllib.php on line 44
        PHP Warning: require_once() [<a href='function.require-once'>function.require-once</a>]: Unable to allocate memory for pool. in /lib/dml/moodle_database.php on line 30

        Show
        Jorge Ramos added a comment - Hi! It's happening to us too!! I think that it's something that teachers changed in that resources, this teacher uses a lot of duplication... I've delimited the problem to the visibility (hidden works!) of some resources in the course (it only happens in one). If I click in the eye to make visible the activity I get the 'pool memory' error, then I update directly the DB: mdl_course_modules -> visible = 1 mdl_course -> modinfo = null Then I refresh the main page of course and it's work ok, and I click in the eye to hide the activity and it works too, but if I click again it crashes... The log messages: PHP Warning: require_once() [<a href='function.require-once'>function.require-once</a>] : Unable to allocate memory for pool. in /lib/dml/mysqli_native_moodle_database.php on line 31 PHP Warning: require_once() [<a href='function.require-once'>function.require-once</a>] : Unable to allocate memory for pool. in /lib/dml/mysqli_native_moodle_database.php on line 32 PHP Warning: require_once() [<a href='function.require-once'>function.require-once</a>] : Unable to allocate memory for pool. in /lib/dml/mysqli_native_moodle_temptables.php on line 31 PHP Warning: require_once() [<a href='function.require-once'>function.require-once</a>] : Unable to allocate memory for pool. in /lib/setup.php on line 444 PHP Warning: require_once() [<a href='function.require-once'>function.require-once</a>] : Unable to allocate memory for pool. in /lib/dmllib.php on line 44 PHP Warning: require_once() [<a href='function.require-once'>function.require-once</a>] : Unable to allocate memory for pool. in /lib/dml/moodle_database.php on line 30
        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. It was reported as affecting versions that are no longer supported.

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

        Michael d.

        TW9vZGxlDQo=

        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. It was reported as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.5 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d. TW9vZGxlDQo=
        Hide
        Michael de Raadt added a comment -

        I'm closing this issue as it has been inactive for over a year has been recorded as affecting versions that are no longer supported.

        This is being done as part of a bulk annual clean-up of issues.

        If you still believe this is an issue in supported versions, please create a new issue.

        Show
        Michael de Raadt added a comment - I'm closing this issue as it has been inactive for over a year has been recorded as affecting versions that are no longer supported. This is being done as part of a bulk annual clean-up of issues. If you still believe this is an issue in supported versions, please create a new issue.

          People

          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: