Import activities tool runs out of memory when trying to load a large number of courses user has taught in, encountered within environment running 2500 courses logged in as administrator with memory_limit of 96M.
Upon selecting import within any course the following error is displayed: "PHP Fatal error: Allowed memory size of 100663296 bytes exhausted (tried to allocate 86 bytes) in /moodle/lib/dmllib.php on line 728, referer: http://<moodlesite>/course/view.php?id=1225".
The file course/import/activities/mod.php loads all courses where user has permission 'moodle/course:update' but does not restrict fields causing the result set to become quite large in certain scenarios.
This bug may be difficult to replicate due to number of courses in my environment but you will need to create a large number of courses, be logged in with moodle/course:update permissions on all courses and select import course on any course.
I've attached a patch to restrict fields to id and fullname, which are the only fields required to import activities.