Skip to content

Conversation

@dogi
Copy link
Member

@dogi dogi commented Nov 10, 2025

The uploadExamResult function was loading all exam submissions into memory before serialization, causing an OutOfMemoryError on devices with a large number of submissions.

This change refactors the function to use a batching strategy:

  1. It first queries only the IDs of the submissions that need to be uploaded.
  2. It then processes these IDs in batches.
  3. For each batch, it fetches the full submission objects from Realm, serializes them, and uploads them.

This approach ensures that only a small, manageable number of submissions are held in memory at any given time, resolving the crash.


https://jules.google.com/session/13589167571013959552

The `uploadExamResult` function was loading all exam submissions into memory before serialization, causing an `OutOfMemoryError` on devices with a large number of submissions.

This change refactors the function to use a batching strategy:
1. It first queries only the IDs of the submissions that need to be uploaded.
2. It then processes these IDs in batches.
3. For each batch, it fetches the full submission objects from Realm, serializes them, and uploads them.

This approach ensures that only a small, manageable number of submissions are held in memory at any given time, resolving the crash.
@dogi dogi added triage Further information is requested experiment close? labels Nov 10, 2025
@dogi dogi closed this Nov 10, 2025
@dogi dogi reopened this Nov 10, 2025
@dogi dogi removed the close? label Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

experiment triage Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants