fix: try to reduce sqlite cursor memory usage #375
Merged
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 defertransferInterceptedIdentify
call (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.