Skip to content

[0.77][Android] Memory Profiling not working, causing dev tools to disconnect #49158

@Kartik4152

Description

@Kartik4152

Description

Hi folks,
I've been trying to profile my apps memory usage using React Native DevTools but anytime I try to take a heap snapshot I get the following error:

An error occurred when a call to method 'buildSnapshot' was requested

TypeError: Cannot read properties of undefined (reading 'length')
    at b.initialize (http://127.0.0.1:8081/debugger-frontend/entrypoints/heap_snapshot_worker/heap_snapshot_worker.js:1:13359)
    at new b (http://127.0.0.1:8081/debugger-frontend/entrypoints/heap_snapshot_worker/heap_snapshot_worker.js:1:33684)
    at A.buildSnapshot (http://127.0.0.1:8081/debugger-frontend/entrypoints/heap_snapshot_worker/heap_snapshot_worker.js:1:43578)
    at HeapSnapshotWorkerDispatcher.dispatchMessage (http://127.0.0.1:8081/debugger-frontend/entrypoints/heap_snapshot_worker/heap_snapshot_worker.js:1:47247)

This issue is not isolated to my android device, other people on my team are facing the same issue using other android devices and even on emulator.

Steps to reproduce

  1. Create a new app using expo.
  2. Upgrade it to RN 0.77
  3. Connect a physical device using a wire.
  4. Run the app, open dev tools, go to memory tab and click on Take Snapshot
  5. Error

React Native Version

0.77.0

Output of npx react-native info

System:
  OS: macOS 14.5
  CPU: (8) arm64 Apple M1
  Memory: 63.67 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.20.4
    path: ~/.nvm/versions/node/v18.20.4/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v18.20.4/bin/yarn
  npm:
    version: 10.7.0
    path: ~/.nvm/versions/node/v18.20.4/bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK:
    Android NDK: 26.1.10909125
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2411.12071903
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /opt/homebrew/opt/openjdk@17/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.1.3
    wanted: ^15.1.3
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.77.0
    wanted: ~0.77.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Screenshots and Videos

Image
Screen.Recording.2025-02-04.at.3.13.00.PM.mov

Metadata

Metadata

Assignees

Labels

BugDebuggingIssues related to React Native DevTools or legacy JavaScript/Hermes debuggingImpact: CrashNever gets stalePrevent those issues and PRs from getting stale

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions