-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
fix(ios): stops leaking memory on system keyboard rotation #6552
Conversation
User Test ResultsTest specification and instructions
Test Artifacts |
I presume that the keyboard still has to reload after rotation for your testing setup, right? Just... no memory leak now? |
Yes, the keyboard is still reloaded whenever I rotate, but is now able to clean up the old keyboard view after the rotation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Note: still need to complete user testing before merge. |
@mcdurdin How do we define user tests to determine whether memory is leaking or not? I could only do so with development tools. |
Re user tests, I'm looking more at regression tests -- making sure there are no unexpected functionality breakages -- in PRs like this one. |
Investigation of #6191 has determined another circumstance that may cause the same behavior that leads to memory leaks. I'd strongly advise checking these changes against the experiments documented in this comment: #6191 (comment). Additionally, there's an interesting WebView callback documented there that may be worth some consideration. A question: does this anti-leak fix prevent replication of the WebView in Safari's Develop menu? That is... -> If it does prevent the old instance from being preserved, that sounds like a potential basis for user tests. They'd be a bit technical, and would require setup (b/c Safari's Develop menu), but it'd at least be a viable approach. |
There's no reason why we can't get a dev to run a test -- there's no rule saying only testers can run tests. So I think in this case, one of the dev team should test the built artifact (that is, @sgschantz or @jahorton most likely). I think it'll be a quick and straightforward test for you. That's aside from the regression test which is still important for the test team to run. |
User Testing
|
I tested to see whether Keyman instances continue to be added to the Safari Developer menu, and they are being cleaned up. However, two appear when SWKeyboard is first attached. After rotating, it jumps to three, but it drops back down to two again within seconds. This happens for each rotation. Not sure why I would have two entries for Keyman instead of one. That could still be a problem, but the leak appears to be gone. My User Test Results are not appearing as I would expect them to...did I fail to specify them correctly? |
Is one the in-app and the other the system keyboard perhaps?
Looks like you specified correctly. This was due to an issue on keymanapp/status.keyman.com#253, now resolved. |
|
Changes in this pull request will be available for download in Keyman version 15.0.251-beta |
fixes #6547
Rotation of the Keyman system in iOS was causing the app to leak memory as the old web view instances used to implement the system keyboard were not being deallocated. This would cause the Keyman keyboard extension to consume more memory and potentially become unstable.
Before this fix, memory consumption increases with each rotation and is not released:
After this fix, memory is quickly reclaimed after many rotations as shown in Xcode: