Skip to content
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

[Style] flexWrap causes CPU 100% and freezes the app #2221

Closed
grabbou opened this issue Aug 4, 2015 · 3 comments
Closed

[Style] flexWrap causes CPU 100% and freezes the app #2221

grabbou opened this issue Aug 4, 2015 · 3 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@grabbou
Copy link
Contributor

grabbou commented Aug 4, 2015

Hey,

This issue is surely super hard to replicate as it happens only on one view - when I push route from List and then, pop to go back. When I click pop, componentWillUmount is called on that route but screen freezes and nothing animates/changes. This started happening after upgrading from 0.7 to 0.8. I tried replacing the route I push from ListView in order to make sure it's not its fault and nothing has changed, so I am blaming the ListView. It's just a simple List with 2 sections and ~20 rows with text. Replacing ListView with manual this.items.map(item => <Text>{item.title}</Text>) changes nothing and the exception still occurs.

Profiling shows that the following call stack keeps running forever:

Running Time    Self (ms)       Symbol Name
29282.0ms  100.0%   0,0     _dispatch_worker_thread3  0x3ddd5
29282.0ms  100.0%   1,0      start_wqthread
29281.0ms   99.9%   0,0       _pthread_wqthread
29281.0ms   99.9%   0,0        _dispatch_worker_thread3
29281.0ms   99.9%   0,0         _dispatch_root_queue_drain
29276.0ms   99.9%   0,0          _dispatch_queue_invoke
29276.0ms   99.9%   0,0           _dispatch_queue_drain
29275.0ms   99.9%   0,0            _dispatch_client_callout
29235.0ms   99.8%   0,0             _dispatch_call_block_and_release
29142.0ms   99.5%   0,0              __42-[RCTBatchedBridge _handleBuffer:context:]_block_invoke363
29141.0ms   99.5%   1,0               -[RCTUIManager batchDidComplete]
29108.0ms   99.4%   0,0                -[RCTUIManager uiBlockWithLayoutUpdateForRootView:]
29106.0ms   99.3%   0,0                 -[RCTShadowView collectRootUpdatedFrames:parentConstraint:]
29104.0ms   99.3%   0,0                  layoutNode
29104.0ms   99.3%   0,0                   layoutNodeImpl
29104.0ms   99.3%   0,0                    layoutNode
29104.0ms   99.3%   0,0                     layoutNodeImpl
29104.0ms   99.3%   0,0                      layoutNode

Any tips/hints what to test/debug more in order to fix that?

@grabbou
Copy link
Contributor Author

grabbou commented Aug 4, 2015

Ok, the issue is when this combination of style is applied to a View:

row: {
    flex: 1,
    alignItems: 'stretch',
    justifyContent: 'space-between',
    flexDirection: 'row',
    flexWrap: 'wrap'
  },

Removing flexWrap: 'wrap' fixes the issue. Any ideas why? Generally it paints quite well and does what it should do, looks like it just freezes when component is about to animate out.

@grabbou grabbou changed the title [Navigator] pop causes 100% CPU and loops forever [Style] flexWrap causes CPU 100% and freezes the app Aug 4, 2015
@ide
Copy link
Contributor

ide commented Aug 4, 2015

IIRC there's an open bug about row + wrap locking up the CPU. Sounds like this could be the same issue.

@grabbou
Copy link
Contributor Author

grabbou commented Aug 4, 2015

Duplicate of #1378, thanks @ide , just after renaming my issue I started looking for duplicates in repo and found quite a few!

@grabbou grabbou closed this as completed Aug 4, 2015
@facebook facebook locked as resolved and limited conversation to collaborators Jul 22, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants