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

Memory leak when viewing saved form #6483

Closed
seadowg opened this issue Oct 30, 2024 · 0 comments · Fixed by #6497
Closed

Memory leak when viewing saved form #6483

seadowg opened this issue Oct 30, 2024 · 0 comments · Fixed by #6497
Assignees

Comments

@seadowg
Copy link
Member

seadowg commented Oct 30, 2024

Blocked by #5420

ODK Collect version

v2024.3

Problem description

Viewing and then exiting a saved form causes a memory leak as the in memory representation of the form is not cleared away on exit.

Steps to reproduce the problem

  1. Finalize a form
  2. Open the form in Ready to Send
  3. Exit the form

The memory usage of the app will increase each time you repeat 2 and 3 (even after garbage collection).

Expected behavior

The memory increase after viewing a form should be cleaned up by garbage collection.

Other information

This happens because when we open a form to view we start ViewOnlyHierarchyActivity and finish FormFillingActivity immediately without calling exit() which cleans up the form session in FormSessionRepository. This means that the FormController (and other form data) are held in memory indefinitely.

We could potentially fix this easily by just clearing the form session when exiting ViewOnlyHierarchyActivity.

@github-project-automation github-project-automation bot moved this to not ready in ODK Collect Oct 30, 2024
@seadowg seadowg moved this from not ready to inbox in ODK Collect Oct 31, 2024
@seadowg seadowg added blocked and removed blocked labels Oct 31, 2024
@seadowg seadowg self-assigned this Nov 5, 2024
@seadowg seadowg moved this from ready to in progress in ODK Collect Nov 5, 2024
@github-project-automation github-project-automation bot moved this from in progress to done in ODK Collect Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: done
Development

Successfully merging a pull request may close this issue.

1 participant