Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CONTRIB-8227 Memory overflow #50

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

DavidGlasgow
Copy link

When editing a scheduler slot in teacher view, the list of student appointments is presented to the teacher using formslib repeat_elements.

The element being replicated, at minimum, contains the following mform elements:

appointhead header
student group, which contains:
studentid searchableselector
appointid hidden
attended checkbox with label "seen"

Additionally, scheduler may add the following form elements based on configuration of the scheduler:
grade select with label "grade" to the above group
appointmentnote editor
teachernote editor

Then all appointments have
deletestudent checkbox

The header element includes the "{no}" wildcard which injects a numeric count into the Appointment header, e.g. "Appointment 1, Appointment 2 etc.."
formslib repeatelements always starts this count at zero and doesn't support paging of this numeric out of the box.

studentid as searchableselector with many available students on the course of the scheduler, can dramatically increase the RAM usage per appointment.

In testing, a representative course without grading, appointment or teacher notes, with a single slot with 89 appointments, on a course with 375 participants, generated a peak RAM of 1.3 GB, or about ~15 MB per appointment.

So we have two combining forces: The number of appointments in a single slot, multiplied by the number of participants in the course.

In my testing, changing studentid from searchableselector to autocomplete reduces the RAM footprint for each appointment that is repeated to ~2 MB to the RAM usage on the server, or for 89 appointments, 130 MB, just higher than a commonly usage php_memory_limit value of 128 MB.

KadeerCanada and others added 30 commits December 8, 2021 12:30
There is no 's' in the language file
Update README.md and create GitHub Actions.
New format for event ids, no longer including course id
Enforce that end time is larger than start time
Achieving green pill in plugins db.
CONTRIB-9214 Fix attachments not viewable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants