Repository navigation
Fix #720 GC issue - No weak ref found - #744
Merged
Merged
Conversation
|
💔 |
Contributor
Author
|
run ci |
|
💚 |
petekanev
force-pushed
the
pete/fix-gc-issue-no-weakref
branch
from
April 24, 2017 10:17
979ed58 to
21c8834
Compare
|
💚 |
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.
The proposed changes address the problem described in issue #720 - having the GC trigger during navigation can sometimes collect children of composite views, before recursively iterating over said children. That could happen if real Java objects were considered unreachable, while their JS counterparts were still accessible as elements of view's children (js array) property, or vice versa. (Best explained in mslavcher's blog - https://iobservable.net/blog/2014/06/07/synchronizing-gc-in-java-and-v8/)
As an additional step now, during GC, array objects marked for collection will be iterated over to check whether references are reachable in JavaScript, in which case their Java proxies shouldn't be released.
Implementation considerations: Depending on the application, this modification can impose a slight performance hit where huge arrays are used inside implementation objects (extending classes and implementing interfaces)