fix: try to reduce sqlite cursor memory usage#375
Merged
justin-fiedler merged 2 commits intomainfrom Jul 7, 2023
Merged
Conversation
Contributor
justin-fiedler
left a comment
There was a problem hiding this comment.
Thanks @falconandy. See questions.
justin-fiedler
approved these changes
Jul 7, 2023
github-actions bot
pushed a commit
that referenced
this pull request
Jul 7, 2023
## [2.39.7](v2.39.6...v2.39.7) (2023-07-07) ### Bug Fixes * try to reduce sqlite cursor memory usage ([#375](#375)) ([77e508d](77e508d))
|
🎉 This PR is included in version 2.39.7 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://github.com/amplitude/Amplitude-Android/blob/main/CHANGELOG.md#2100-oct-12-2016
https://github.com/amplitude/Amplitude-Android/blob/main/src/main/java/com/amplitude/api/AmplitudeClient.java#L444
https://github.com/amplitude/Amplitude-Android/blob/main/src/main/java/com/amplitude/api/AmplitudeClient.java#L2187
New logic was added recently (
IdentifyInterceptor.transferInterceptedIdentify) that can throwCursorWindowAllocationException- the exception is not caught/handled in this case. I believe, we can’t defertransferInterceptedIdentifycall (similar toIf the exception is caught during the uploading of unsent events, then the upload is deferred to a later time).To reduce cursor memory usage now each event is loaded from sqlite database with separate query/cursor. Hope it helps.
Currently my environment doesn't work with Amplitude-Android (build/test) - so I didn't test properly (CI tests only).
Some unused code is removed.