-
-
Notifications
You must be signed in to change notification settings - Fork 217
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
Creating child documents using repeat groups causing android-wraper to crash #6136
Comments
Looking at this, it seems like the cause of the overallocation of memory is one of the calculations in the form: Because this refers to a repeat, every time a new repeat entity is added, every other existent repeat entity is recalculated in order to provide this new value, not just the one scoping the calculate (the "parent"). Is it feasible to change the "calculate" field to something else and update the documentation to reflect this? |
Can we use the test harness to automatically fail tests when the form allocates too much to the heap? Can the harness somehow flag scenarios similar to this? If so, we could enforce best practices like this across projects? |
@derickl Can I, please, get some feedback about my comment above? @garethbowen , you were curious if this happens on latest |
@dianabarsan We could probably change how we arrive child_doc. (and update the documentation) medic/medic-docs#208 |
Does anyone have any objections to closing this and going with the workaround Diana found plus the documentation issue Derick raised? |
Do 8 objection-less days count as no objections? |
It seems like there are no objections so I'm closing this as Won't Fix so we can move forward with 3.9.0. Let me know if there's more we can do here. |
Related to medic/cht-core#6136 Resolves #208
Related to medic/cht-core#6136 Resolves #208 Co-authored-by: Derick Lung'aho <derick.lungaho@users.noreply.github.com>
Describe the bug
Creating linked documents as per the
Creating Additional Docs
sections of this doc is not working as expected. If we created documents as outlined inRepeated Docs Example
and the child document is explicitly bound to the repeat, there's an overallocation of memory (300MB) compared to 50 MB when the child document is bound to a group directly wrapped under the repeat.On typical CHW phones (1GB) , we consistently run out of memory and crash when using the original form https://medic.slack.com/files/U1ZF01J12/FQS6DJ2BF/pregnancy_outcomes.xlsx
I'm attaching two forms to illustrate when the feature is working and when it's breaking.
Test files
pregnancy_outcomes_buggy.xlsx
pregnancy_outcomes_fixed.xlsx
To Reproduce
Steps to reproduce the behavior:
Pregnancy Outcome
How many children
Expected behavior
No crashing when running on mobile, especially memory constrained models that we recommend to partners.
Environment
Additional context
A workaround to what's explicit documented in https://github.com/medic/medic-docs/blob/master/configuration/forms.md is to bind the child document to a group immediately under the repeat.
Using the original partner form, memory allocation jumps from around 50MB to 3GB.
This has been reported by D-Tree and PIH
The text was updated successfully, but these errors were encountered: