App Hanging: "App hanging for at least 2000 ms" reported by Sentry

2.3k views Asked by At

I've been encountering the "App hanging for at least 2000 ms" issue multiple times while using Sentry. The app seems to be experiencing significant delays, and I'm having trouble pinpointing the root cause of the problem.

Environment:

  • @sentry/react-native: ^5.11.1
  • React Native: 0.72.4
  • Platform: iOS

Additional Information

I've checked the following without success:

Reviewed the Sentry documentation for common causes of performance issues. Ensured that my dependencies are up to date. Checked network requests for potential bottlenecks.

Screenshots: Sentry screen

1

There are 1 answers

9
Shivo'ham On

You need to Improve your application performance

How?

  • Reduce App Size With Code Splitting and Lazy Loading

  • Make Use of Uncontrolled Inputs Make Use of Memory Optimization

  • Make Use of Hermes

  • Enable the RAM Format

  • Make Use of InteractionManager

  • Avoid Anonymous Functions While Rendering

  • Remove Console Statements

  • Avoid the Use of ScrollView to Render Huge Lists

  • Avoid Passing Inline Functions as Props

  • Use Cache Images or local images must be webp type image

  • Use nativeDriver With the Animated Library

  • Avoid Arrow Functions

  • Avoid Excessive Use of Higher-Order Components

  • Use Style References Correctly

Or you can disable the warning if you want

The app hang detection integration has a default timeout of two (2) seconds and You can change the timeout by setting the appHangTimeoutInterval option:

import * as Sentry from "@sentry/react-native";

Sentry.init({
  dsn: "DSN",
  appHangTimeoutInterval: 1,
});