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

0.62 JSC hit 100% cpu in Release, not Debug #28537

Closed
fungilation opened this issue Apr 5, 2020 · 3 comments
Closed

0.62 JSC hit 100% cpu in Release, not Debug #28537

fungilation opened this issue Apr 5, 2020 · 3 comments
Labels
Needs: Triage 🔍 Resolution: Locked This issue was locked by the bot.

Comments

@fungilation
Copy link

fungilation commented Apr 5, 2020

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

Before upgrading, my app was on RN 0.61.5. No issue on cpu pegged at 100%.

After upgrade to 0.62.1, on certain number crunching in JS and I can't identify exactly in what yet (reason below). I'm getting 100% cpu pegged and app completely stalled from doing anything else, though UI is not frozen. This is due to JSC is completely blocked. This is when app is built in release mode, and so JSC is run on real device (iPhone X)
image

If I rebuilt app in Debug mode, running on same real device, and doing same UX on app. No more issue as JS processing is run in Chrome's V8 instead:
image

React Native version:

System:
    OS: macOS 10.15.4
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
    Memory: 2.00 GB / 40.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 13.12.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      Android NDK: 21.0.6113669
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.6010548
    Xcode: 11.4/11E146 - /usr/bin/xcodebuild
  Languages:
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.11.0 => 16.11.0
    react-native: 0.62.1 => 0.62.1
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

I can't list repro steps as I'm not sure what in my JS code is triggering the 100% cpu in JSC, that doesn't occur in Debug mode V8. But there's clearly something changed from RN 0.61 -> 0.62 upgrade that changed it.

And since I can't debug while the JSC cpu pegged occurs only in Release mode, this makes this a Heisenbug. How do I debug when app in debug mode doesn't manifest the same issue that's in release?

Expected Results

JSC not stalled in Release mode on device

@fungilation
Copy link
Author

fungilation commented Apr 7, 2020

Isolated cause of JSC CPU pegging to be somewhere in react-native-cached-image in my app. I'm deprecating its use to just use RN's own Image.

@lackd
Copy link

lackd commented Jun 7, 2020

Hi, I'm facing the same issue, using the Image native component didn't solve the problem. Actually, even I'm trying with real device Iphone X and emulator, same result... But. when I run the project with iPhone 11 Pro max emulator OS 13.3, the problem is not there, the CPU is at 0%. I've searched everywhere and this is the only topic that seems to be the same issue. I need some help here.

@avencat
Copy link

avencat commented Jun 12, 2020

Hi @fungilation and thank you for your fork of react-native-cached-image! 🎉

I'm upgrading my app to RN 0.62 and I just saw that react-native-cached-image as been deprecated in favor of RN's own image but I was wondering if you managed to make RN's Images cache work on Android as the documentation says that Cache Control is only for iOS...

Thanks for your response! 😊

@facebook facebook locked as resolved and limited conversation to collaborators Oct 1, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Triage 🔍 Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants