bugsnag-js icon indicating copy to clipboard operation
bugsnag-js copied to clipboard

[iOS] Memory stats are not accurate

Open cristianoccazinsp opened this issue 4 years ago • 4 comments

Describe the bug

Total and used memory reports on bugsnag seem to be incorrect, or far from the real usage.

Steps to reproduce

Just use an app and have it consume some memory. Log to bugsnag and observe memory usage.

Environment

  • Bugsnag version: "@bugsnag/react-native": "7.3.3"
  • CocoaPods version (if any): 1.9.1
  • Xcode version (if any): 11.7
  • iOS/Android version(s): iOS 13.6.x
  • simulator/emulator or physical device: Device
  • Using Hermes on Android?: No
  • debug mode or production?: Production

Example code snippet

The following captures show a production build connected to XCode's debugger. As you can see, XCode memory usage and bugsnag memory report greatly differ and is extremely inaccurate.

XCode memory usage: Screen Shot 2020-09-08 at 14 16 11

Bugsnag info sent approximately 24 seconds after the first capture: Screen Shot 2020-09-08 at 14 16 00

This test was done with a code that is likely to be having a memory leak; hence, it is probably not reported by normal memory usage APIs.

cristianoccazinsp avatar Sep 08 '20 17:09 cristianoccazinsp

In addition, not even the totalMemory value is accurate; it changes to a different value pretty much for every log (from 1.4 to 2GB on iPhone 7, for example).

cristianoccazinsp avatar Sep 08 '20 19:09 cristianoccazinsp

@cristianoccazinsp thanks for raising, we're going to take a look and will post any updates here.

steve-nester-uk avatar Sep 09 '20 15:09 steve-nester-uk

This has been transferred to the bugsnag-js repo as the Bugsnag react native library is now part of this repository (as of v7.3).

johnkiely1 avatar Sep 14 '20 11:09 johnkiely1

@cristianoccazinsp

We have confirmed this as bug, we are investigating solutions and will update again once we have identified a way forward.

johnkiely1 avatar Sep 21 '20 11:09 johnkiely1