microsoft / o365-moodle

Office 365 and Azure Active Directory plugins for Moodle
GNU General Public License v3.0
184 stars 138 forks source link

Excessive memory allocation #2682

Open drink-uj opened 1 month ago

drink-uj commented 1 month ago

The optimization is required. PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 4194312 bytes) in local/o365/classes/rest/unified.php on line 206

For more than 100,000 team groups, after running the cron process to sync Moodle courses with Microsoft Teams (\local_o365\task\coursesync), I get this result:

Execute scheduled task: Create user groups in Microsoft 365 package (local_o365\task\coursesync) 
... started 17:45:17. 
Current memory use 36.0 MB. 
Start syncing courses. Tenant has education license: yes Restore groups that have been soft-deleted... 
Processing courses without groups... 
... All courses have groups created. 
Processing courses without teams... 
... All courses have teams created. 
Updating teams cache..

The process stops at this stage without returning any error and begins to block all tasks in the Moodle cron queue.

bts0004 commented 1 month ago

Which version are you using? Is this pre-/post- the recent update to 4.4.1?

drink-uj commented 1 month ago

I use Moodle 4.1, and the version of my plugin is 4.1.8, which is from before the last update.