bugsnag-js
bugsnag-js copied to clipboard
[iOS] Memory stats are not accurate
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:
Bugsnag info sent approximately 24 seconds after the first capture:
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.
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 thanks for raising, we're going to take a look and will post any updates here.
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).
@cristianoccazinsp
We have confirmed this as bug, we are investigating solutions and will update again once we have identified a way forward.