Skip to content

Conversation

petekanev
Copy link
Contributor

With the current implementation the SparseArrays used to hold and manage the Java instances of objects created in JavaScript becomes/is considered 'corrupt' at some point, and would cause an application crash during garbage collection.

Replacing the SparseArray with HashMap of <Integer, Object> appears to prevent those crashes from happening, and although SparseArray is the recommended data structure when memory is a concern in an app - the use of HashMap does not seem to cause any negative effects or a memory overhead when comparing the same application before and after switching to HashMap.

Ideally we want to revert back to using SparseArray to store objects when the original issue in AOSP is addressed and pushed as an update.

Addresses #838

@petekanev petekanev self-assigned this Oct 9, 2017
@petekanev petekanev requested a review from Plamen5kov October 9, 2017 07:30
@ns-bot
Copy link

ns-bot commented Oct 9, 2017

💚

Copy link
Contributor

@Plamen5kov Plamen5kov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with emulators 19, 23, 25, 26 and it seems to work fine for the base scenarios. We should monitor the CI tests ... just in case some bigger application fails.

@petekanev
Copy link
Contributor Author

run ci

@ns-bot
Copy link

ns-bot commented Oct 9, 2017

💚

@petekanev petekanev merged commit 88731f9 into master Oct 9, 2017
@petekanev petekanev deleted the pete/api26-crash branch October 9, 2017 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants