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

Memory leak in modinfo cache when rebuilding cache entry for different users

XMLWordPrintable

    • MOODLE_20_STABLE

      External database enrolments end up firing off a user_enrolled event (as you'd expect), this event is picked up by the forum mod in order to subscribe the user to any relevant forums.
      The process used for looking up the forums to subscribe them to uses get_fast_modinfo. In MDL-25191 the cache wasn't properly destroying the entries when unsetting them because the cache was full.

      Here, when enrolling, say, 1000 users in a course, its calling get_fast_modinfo for the same course, but for 1000 users. When it already has an entry in the cache for the course, but the user doesn't match, it's doing a simple "unset($cache[$course->id]);" instead of destroying the object properly.

      This issue is reproducible on php5.2 where the php gc doesn't properly clean up recursively linked objects. The memory isn't as quickly freed in php5.3, but testing has shown that by destroying it properly earlier, memory usage is kept down.

            skodak Petr Skoda
            aolley Adam Olley
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.