React-native: Android Throwing OutOfMemoryError crash

Created on 30 Aug 2016  路  57Comments  路  Source: facebook/react-native

Issue Description

My app crash every 5 minutes on my android remote device, even if I'm not doing anything on it (live reload or whatever)

Additional Information

  • React Native version: 0.32.0
  • Platform: Android API 23 or 24 (remote device, tried with both api version)
  • Operating System: macOS 10.11.6
  • Logs:
08-30 15:25:56.281 31863  4974 W art     : Throwing OutOfMemoryError "pthread_create (1040KB stack) failed: Try again"
08-30 15:25:56.286 31863  4974 E AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
08-30 15:25:56.286 31863  4974 E AndroidRuntime: Process: com.bulbthings.app, PID: 31863
08-30 15:25:56.286 31863  4974 E AndroidRuntime: java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at java.lang.Thread.nativeCreate(Native Method)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at java.lang.Thread.start(Thread.java:730)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:941)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1359)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.ConnectionPool.put(ConnectionPool.java:135)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.OkHttpClient$1.put(OkHttpClient.java:149)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:188)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:129)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:98)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.RealCall.access$100(RealCall.java:33)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.RealCall$AsyncCall.execute(RealCall.java:120)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
08-30 15:25:56.286 31863  4974 E AndroidRuntime:    at java.lang.Thread.run(Thread.java:761)
08-30 15:25:56.292   880  3516 W ActivityManager:   Force finishing activity com.bulbthings.app/.MainActivity
08-30 15:25:56.310   880  4335 I sensors : activate
08-30 15:25:56.312   880  4335 I nanohub : queueActivate: sensor=1, handle=1, enable=0
08-30 15:25:56.475   880 14298 I OpenGLRenderer: Initialized EGL, version 1.4
08-30 15:25:56.475   880 14298 D OpenGLRenderer: Swap behavior 1
08-30 15:25:56.888 31863   337 W unknown:React: Tried to enqueue runnable on already finished thread: 'native_modules... dropping Runnable.
08-30 15:25:56.889 31863   337 W MessageQueue: Handler (com.facebook.react.bridge.queue.MessageQueueThreadHandler) {44af903} sending message to a Handler on a dead thread
08-30 15:25:56.889 31863   337 W MessageQueue: java.lang.IllegalStateException: Handler (com.facebook.react.bridge.queue.MessageQueueThreadHandler) {44af903} sending message to a Handler on a dead thread
08-30 15:25:56.889 31863   337 W MessageQueue:  at android.os.MessageQueue.enqueueMessage(MessageQueue.java:543)
08-30 15:25:56.889 31863   337 W MessageQueue:  at android.os.Handler.enqueueMessage(Handler.java:643)
08-30 15:25:56.889 31863   337 W MessageQueue:  at android.os.Handler.sendMessageAtTime(Handler.java:612)
08-30 15:25:56.889 31863   337 W MessageQueue:  at android.os.Handler.sendMessageDelayed(Handler.java:582)
08-30 15:25:56.889 31863   337 W MessageQueue:  at android.os.Handler.post(Handler.java:338)
08-30 15:25:56.889 31863   337 W MessageQueue:  at com.facebook.react.bridge.queue.MessageQueueThreadImpl.runOnQueue(MessageQueueThreadImpl.java:61)
08-30 15:25:56.889 31863   337 W MessageQueue:  at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
08-30 15:25:56.889 31863   337 W MessageQueue:  at android.os.Handler.handleCallback(Handler.java:751)
08-30 15:25:56.889 31863   337 W MessageQueue:  at android.os.Handler.dispatchMessage(Handler.java:95)
08-30 15:25:56.889 31863   337 W MessageQueue:  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
08-30 15:25:56.889 31863   337 W MessageQueue:  at android.os.Looper.loop(Looper.java:154)
08-30 15:25:56.889 31863   337 W MessageQueue:  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
08-30 15:25:56.889 31863   337 W MessageQueue:  at java.lang.Thread.run(Thread.java:761)
08-30 15:25:56.932   880   900 I WindowManager: Destroying surface Surface(name=com.bulbthings.app/com.bulbthings.app.MainActivity) called by com.android.server.wm.WindowStateAnimator.destroySurface:2014 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:881 com.android.server.wm.WindowState.removeLocked:1449 com.android.server.wm.WindowManagerService.removeWindowInnerLocked:2478 com.android.server.wm.AppWindowToken.destroySurfaces:365 com.android.server.wm.WindowStateAnimator.finishExit:565 com.android.server.wm.WindowStateAnimator.stepAnimationLocked:491 com.android.server.wm.WindowAnimator.updateWindowsLocked:303 
08-30 15:25:56.981  7622  7662 W OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...
08-30 15:26:00.091 31863 31874 W art     : Suspending all threads took: 5.472ms
08-30 15:26:01.887 31863 31874 W art     : Suspending all threads took: 5.457ms
08-30 15:26:36.303  3355  3355 I DownloadManagerWrapper: onReceive() : Charging = true
08-30 15:27:36.303  3355  3355 I DownloadManagerWrapper: onReceive() : Charging = true
08-30 15:27:36.457   880   893 I ActivityManager: Killing 19125:com.android.chrome/u0a48 (adj 906): empty for 1800s

Adding

<application
  android:largeHeap="true"

to the Manifest.xml doesn't help

Android Ran Commands Locked

Most helpful comment

Hi! Same problem here on Android. I've just started a project with react-native init and begun to follow the Facebook tutorial. When I run the app without debugging, it works fine. If I enable _Debug JS remotely_, it crashes after 1 minute (doing nothing).

Testing on Samsung Galaxy S5, Android 5.0, react-native-cli 0.2.0, react-native 0.32.1, Windows 7, Chrome 53.

It's a really simple app (I'm starting with RN), with just a couple of text components and an image, and I'm getting exactly the same stacktrace.

Since it's an OutOfMemory problem I've tried to add android:largeHeap="true" to Manifest.xml, but nothing changes. The app reaches around 32Mb and crashes.

I've modified my app, so it loads a component with an image 5000 times. With the debugging disabled, the app allocates up to 70Mb and works fine. I can scroll all over the screen and nothing crashes. So is not a low memory problem on the device.

When I enable the remote debugging, it works for a while, until it tries to allocate more memory and crashes again (around 1-2 minutes). If I launch the app with the debugging already enabled, it starts well (and goes up to the 70Mb fine), but again crashes after a while.

The debugging is constantly consuming memory until it eventually crashes when (I think) it needs to allocate a new chunk of memory.

All 57 comments

I get this same crash, closer to only 1 minute after launch (also not doing anything). Seems to only happen when debugging through Chrome.

Same here with a remote Android 5.0.2 while debugging through Chrome.

Hi! Same problem here on Android. I've just started a project with react-native init and begun to follow the Facebook tutorial. When I run the app without debugging, it works fine. If I enable _Debug JS remotely_, it crashes after 1 minute (doing nothing).

Testing on Samsung Galaxy S5, Android 5.0, react-native-cli 0.2.0, react-native 0.32.1, Windows 7, Chrome 53.

It's a really simple app (I'm starting with RN), with just a couple of text components and an image, and I'm getting exactly the same stacktrace.

Since it's an OutOfMemory problem I've tried to add android:largeHeap="true" to Manifest.xml, but nothing changes. The app reaches around 32Mb and crashes.

I've modified my app, so it loads a component with an image 5000 times. With the debugging disabled, the app allocates up to 70Mb and works fine. I can scroll all over the screen and nothing crashes. So is not a low memory problem on the device.

When I enable the remote debugging, it works for a while, until it tries to allocate more memory and crashes again (around 1-2 minutes). If I launch the app with the debugging already enabled, it starts well (and goes up to the 70Mb fine), but again crashes after a while.

The debugging is constantly consuming memory until it eventually crashes when (I think) it needs to allocate a new chunk of memory.

This is a bug with remote-debugging. For some reason it constantly tries to open a connection to port 8087 and runs out of memory with the sockets.

I'm running in either the same or similar issue. Everything seems to be fine with my app when I don't have remote js debugging on. When I turn it on the app crashes. In my case I can't say when exactly the app crashes. Sometimes it could be 30s. other times 2 mins.

Here is the output from adb logcat

09-25 14:40:49.968 20966 27354 W libc    : pthread_create failed: couldn't allocate 1069056-bytes mapped space: Out of memory
09-25 14:40:49.969 20966 27354 W art     : Throwing OutOfMemoryError "pthread_create (1040KB stack) failed: Try again"
09-25 14:40:49.974 20966 27354 E AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
09-25 14:40:49.974 20966 27354 E AndroidRuntime: Process: com.compojoom.android.react.farmerjoe, PID: 20966
09-25 14:40:49.974 20966 27354 E AndroidRuntime: java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at java.lang.Thread.nativeCreate(Native Method)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at java.lang.Thread.start(Thread.java:1063)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:921)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1339)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.ConnectionPool.put(ConnectionPool.java:135)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.OkHttpClient$1.put(OkHttpClient.java:149)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:188)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:129)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:98)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.RealCall.access$100(RealCall.java:33)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.RealCall$AsyncCall.execute(RealCall.java:120)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
09-25 14:40:49.974 20966 27354 E AndroidRuntime:        at java.lang.Thread.run(Thread.java:818)
09-25 14:40:49.981   898  1872 W ActivityManager:   Force finishing activity com.compojoom.android.react.farmerjoe/.MainActivity
09-25 14:40:49.992   898 27355 W AES     : Exception Log handling...
09-25 14:40:50.027   898   909 E Sensors : handleToDriver handle(0)
09-25 14:40:50.054 20966 20981 W libc    : pthread_create failed: couldn't allocate 1069056-bytes mapped space: Out of memory
09-25 14:40:50.054 20966 20981 W art     : Throwing OutOfMemoryError "pthread_create (1040KB stack) failed: Try again"
09-25 14:40:50.054 20966 20981 W libc    : pthread_create failed: couldn't allocate 1069056-bytes mapped space: Out of memory
09-25 14:40:50.054 20966 20981 W art     : Throwing OutOfMemoryError "pthread_create (1040KB stack) failed: Try again"
09-25 14:40:50.150   898 13886 W libEGL  : [ANDROID_RECORDABLE] format: 1
09-25 14:40:50.234  1430  1844 E MPlugin : Unsupported class: com.mediatek.common.telephony.IOnlyOwnerSimSupport
09-25 14:40:50.274   898   957 E WifiConfigStore: updateConfiguration freq=2457 BSSID=bc:ee:7b:8e:a6:70 RSSI=-66 "GD"WPA_PSK
09-25 14:40:50.391   898   898 E WifiTrafficPoller: TRAFFIC_STATS_POLL true Token 11 num clients 8
09-25 14:40:50.392   898   898 E WifiTrafficPoller:  packet count Tx=1712 Rx=4782
09-25 14:40:50.418   898   948 W InputDispatcher: channel '546835f com.compojoom.android.react.farmerjoe/com.compojoom.android.react.farmerjoe.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
09-25 14:40:50.418   898   948 E InputDispatcher: channel '546835f com.compojoom.android.react.farmerjoe/com.compojoom.android.react.farmerjoe.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
09-25 14:40:50.421   898  2784 W InputDispatcher: Attempted to unregister already unregistered input channel '546835f com.compojoom.android.react.farmerjoe/com.compojoom.android.react.farmerjoe.MainActivity (server)'
09-25 14:40:50.472  1518  1782 W libEGL  : [ANDROID_RECORDABLE] format: 1
09-25 14:40:50.477   898  1016 W InputMethodManagerService: Got RemoteException sending setActive(false) notification to pid 20966 uid 10106
09-25 14:40:50.565   898   918 W AppOps  : Finishing op nesting under-run: uid 1000 pkg android code 24 time=0 duration=0 nesting=0
09-25 14:40:50.693   898   918 W WindowAnimator: Failed to dispatch window animation state change.
09-25 14:40:50.693   898   918 W WindowAnimator: android.os.DeadObjectException
09-25 14:40:50.693   898   918 W WindowAnimator:        at android.os.BinderProxy.transactNative(Native Method)
09-25 14:40:50.693   898   918 W WindowAnimator:        at android.os.BinderProxy.transact(Binder.java:511)
09-25 14:40:50.693   898   918 W WindowAnimator:        at android.view.IWindow$Stub$Proxy.onAnimationStopped(IWindow.java:548)
09-25 14:40:50.693   898   918 W WindowAnimator:        at com.android.server.wm.WindowAnimator.updateWindowsLocked(WindowAnimator.java:315)
09-25 14:40:50.693   898   918 W WindowAnimator:        at com.android.server.wm.WindowAnimator.animateLocked(WindowAnimator.java:736)
09-25 14:40:50.693   898   918 W WindowAnimator:        at com.android.server.wm.WindowAnimator.-wrap0(WindowAnimator.java)
09-25 14:40:50.693   898   918 W WindowAnimator:        at com.android.server.wm.WindowAnimator$1.doFrame(WindowAnimator.java:137)
09-25 14:40:50.693   898   918 W WindowAnimator:        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:892)
09-25 14:40:50.693   898   918 W WindowAnimator:        at android.view.Choreographer.doCallbacks(Choreographer.java:696)
09-25 14:40:50.693   898   918 W WindowAnimator:        at android.view.Choreographer.doFrame(Choreographer.java:628)
09-25 14:40:50.693   898   918 W WindowAnimator:        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:880)
09-25 14:40:50.693   898   918 W WindowAnimator:        at android.os.Handler.handleCallback(Handler.java:815)
09-25 14:40:50.693   898   918 W WindowAnimator:        at android.os.Handler.dispatchMessage(Handler.java:104)
09-25 14:40:50.693   898   918 W WindowAnimator:        at android.os.Looper.loop(Looper.java:207)
09-25 14:40:50.693   898   918 W WindowAnimator:        at android.os.HandlerThread.run(HandlerThread.java:61)
09-25 14:40:50.693   898   918 W WindowAnimator:        at com.android.server.ServiceThread.run(ServiceThread.java:46)
09-25 14:40:50.695   898   918 W WindowAnimator: Failed to dispatch window animation state change.
09-25 14:40:50.695   898   918 W WindowAnimator: android.os.DeadObjectException
09-25 14:40:50.695   898   918 W WindowAnimator:        at android.os.BinderProxy.transactNative(Native Method)
09-25 14:40:50.695   898   918 W WindowAnimator:        at android.os.BinderProxy.transact(Binder.java:511)
09-25 14:40:50.695   898   918 W WindowAnimator:        at android.view.IWindow$Stub$Proxy.onAnimationStopped(IWindow.java:548)
09-25 14:40:50.695   898   918 W WindowAnimator:        at com.android.server.wm.WindowAnimator.updateWindowsLocked(WindowAnimator.java:315)
09-25 14:40:50.695   898   918 W WindowAnimator:        at com.android.server.wm.WindowAnimator.animateLocked(WindowAnimator.java:736)
09-25 14:40:50.695   898   918 W WindowAnimator:        at com.android.server.wm.WindowAnimator.-wrap0(WindowAnimator.java)
09-25 14:40:50.695   898   918 W WindowAnimator:        at com.android.server.wm.WindowAnimator$1.doFrame(WindowAnimator.java:137)
09-25 14:40:50.695   898   918 W WindowAnimator:        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:892)
09-25 14:40:50.695   898   918 W WindowAnimator:        at android.view.Choreographer.doCallbacks(Choreographer.java:696)
09-25 14:40:50.695   898   918 W WindowAnimator:        at android.view.Choreographer.doFrame(Choreographer.java:628)
09-25 14:40:50.695   898   918 W WindowAnimator:        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:880)
09-25 14:40:50.695   898   918 W WindowAnimator:        at android.os.Handler.handleCallback(Handler.java:815)
09-25 14:40:50.695   898   918 W WindowAnimator:        at android.os.Handler.dispatchMessage(Handler.java:104)
09-25 14:40:50.695   898   918 W WindowAnimator:        at android.os.Looper.loop(Looper.java:207)
09-25 14:40:50.695   898   918 W WindowAnimator:        at android.os.HandlerThread.run(HandlerThread.java:61)
09-25 14:40:50.695   898   918 W WindowAnimator:        at com.android.server.ServiceThread.run(ServiceThread.java:46)
09-25 14:40:50.705   898   918 E MultiWindowProxy: getServiceInstance failed!
09-25 14:40:50.711   238   238 W SurfaceFlinger: couldn't log to binary event log: overflow.
09-25 14:40:51.015  1518  1782 W OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer @ab52762, destroying layer...
09-25 14:40:51.015  1518  1782 W OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer @b4fa880, destroying layer...

@fab1an - the crazy thing is that since I launched the memory monitor in android studio yesterday evening the app hasn't crashed once... 9h without a crash... Event after closing Android Studio the app still works without any issues.

No clue what happened here. Before that it was crashing like every minute...

@compojoom Can you still try to look at the Heap with hprof and check it out? I know it takes some getting used to, but it's a vital skill for Android/Java and you might learn what's going on.

Is there an unusual number of Activities, Applications, Images or else not being collected. How long is the finalizer queue and so on.

@fab1an - well I can generate a heap and look at it. But the thing is - if the app isn't crashing anymore how is the heap going to help us?

@compojoom Maybe you find a memory-leak that causes the crash when it get's too large.

If you have an OutOfMemoryError in a Java app the first thing you should do is doing a heap-dump to check where all the memory has gone to.

@fab1an - can you explain something to me. I thought that the heap-dump would work more like the xdebug profiler. You have it running all the time and when you hit the error you have the situation recorded.

The heap-dump seems to be a snapshot of the memory for a second. How is this going to help with debugging the issue if the app crashes 10 mins after the heap-dump was taken? I thought that maybe if I run the memory allocation I'll know more, but when the app crashes the memory monitor stops and the record allocation doesn't complete.

How am I supposed to take a heap-dump that would actually help with debugging this?

@compojoom You could check out the heap-dump for unusual memory usage. If you have 3 activities, 10 views and 200 Bitmaps in the dump, while you app actually has 1 Activity, 5 views and 10 bitmaps, then you know there's something going wrong.

Here is the heap-dump if you are interested. Around 10s later the app crashed.
https://1drv.ms/u/s!ArR5BL6RniuIhZIYRmI_wI1DvC3K2w

For me this is currently Chinese. I'll have to read a lot in order to understand it.

I've run the analizer tasks and it doesn't find any leaked activities, but some duplicated strings ( no idea what that is). The interseting part is that when I click on the STring (jhava.lang) class name I see a lot of instances that have "http://localhost:8097" Why 8097? The debugger should be running on 8081, no?

Sorry, I don't have time to do that work for you.

no problem @fab1an - I didn't mean it to sound that way. I'll try to figure that out.

As far port 8097 is concerned. It seems that it is related to react devtools.

I'll write my findings here.

I still can't figure out why the app crashes (can't find anything out of the ordinary in the heap), but I found the following. When I restart the device - no app crashes.
When I disconnect the phone from the PC and later connect it the app starts to crash. When I reboot the phone - everything is again ok.

Any news on this?

Btw, we encounter this issue since RN 0.34 and above. With an app that is still based on RN 0.26 the issue never happens while debugging with chrome, but apps with RN 0.34 and RN 0.38 have this issue as the others describe above

Having this issue too.

Fatal Exception: java.lang.OutOfMemoryError: pthread_create (stack size 16384 bytes) failed: Try again
       at java.lang.VMThread.create(VMThread.java)
       at java.lang.Thread.start(Thread.java:1029)
       at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:920)
       at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1338)
       at okhttp3.ConnectionPool.put(ConnectionPool.java:135)
       at okhttp3.OkHttpClient$1.put(OkHttpClient.java:149)
       at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:188)
       at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:129)
       at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:98)
       at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
       at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
       at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
       at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
       at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170)
       at okhttp3.RealCall.access$100(RealCall.java:33)
       at okhttp3.RealCall$AsyncCall.execute(RealCall.java:120)
       at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
       at java.lang.Thread.run(Thread.java:841)

RN: 0.35.0

On device with remote debug Chrome Devtools open.
Was there any fixes yet? Or is this corrected in future versions?

Also having this issue. I've been debugging it all day but haven't found a way around it. Appears to be a combination between live reload, debugger and WebView.

+1. Happens after around 1 minute with the app open on a real device and debugging on chrome. RN 0.40.

getting this as well, just enough leaving the app opened for a couple of minutes, using RN 0.43.0-rc.3

03-17 12:12:03.461 26506  2052 E AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
03-17 12:12:03.461 26506  2052 E AndroidRuntime: Process: com.cadastramento, PID: 26506
03-17 12:12:03.461 26506  2052 E AndroidRuntime: java.lang.OutOfMemoryError: pthread_create  (1040KB stack) failed: Try again
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at java.lang.Thread.nativeCreate(Native Method)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at java.lang.Thread.start(Thread.java:1063)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:921)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1339)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.ConnectionPool.put(ConnectionPool.java:135)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.OkHttpClient$1.put(OkHttpClient.java:149)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:188)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:129)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:98)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.RealCall.access$100(RealCall.java:33)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.RealCall$AsyncCall.execute(RealCall.java:120)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
03-17 12:12:03.461 26506  2052 E AndroidRuntime:        at java.lang.Thread.run(Thread.java:818)

pretty constant and reproduceable

Keeping the memory monitor open in android studio solves the problem for me as well, as observered by @compojoom. I'm using RN 0.41

For me it only crashes when I am using remote debugging. ( 0.42.3 )

I have this since I upgraded to the current release 0.42.x .... I was on version 0.40 before and it did not happen there.

Same here : Adding
android:largeHeap="true" to the Manifest.xml doesn't help

When debug app with chrome, there too many 'OkHttp ConnectionPool' thread was created, it result in the app crashed! I think it's dev tool's bug. If the app does't connect to chrome, there is no problem!

@lifanlife Yeah, I also had this only when debugging the app.

We're also having a similar problem
05-02 09:03:55.419 9340 15676 W libc : pthread_create failed: couldn't allocate 1069056-bytes mapped space: Out of memory 05-02 09:03:55.419 9340 15676 W art : Throwing OutOfMemoryError "pthread_create (1040KB stack) failed: Try again" 05-02 09:03:55.421 9340 15676 E AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher 05-02 09:03:55.421 9340 15676 E AndroidRuntime: Process: com.hhs2, PID: 9340 05-02 09:03:55.421 9340 15676 E AndroidRuntime: java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at java.lang.Thread.nativeCreate(Native Method) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at java.lang.Thread.start(Thread.java:1063) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:921) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1339) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.ConnectionPool.put(ConnectionPool.java:135) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.OkHttpClient$1.put(OkHttpClient.java:149) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:188) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:129) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:98) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.RealCall.access$100(RealCall.java:33) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.RealCall$AsyncCall.execute(RealCall.java:120) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 05-02 09:03:55.421 9340 15676 E AndroidRuntime: at java.lang.Thread.run(Thread.java:818) 05-02 09:03:55.424 1152 1728 W ActivityManager: Force finishing activity com.hhs2/.MainActivity 05-02 09:03:55.455 1152 1206 W qti_sensors_hal: timestampCalc: Adjusting timestamp for rollover: 3714701690164348, 6 05-02 09:03:55.468 1152 1187 V BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@7445663 05-02 09:03:55.468 1152 1187 V BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@dfd2260 05-02 09:03:55.502 2394 2397 E ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only 05-02 09:03:55.534 1152 3456 I OpenGLRenderer: Initialized EGL, version 1.4 05-02 09:03:55.535 1152 1781 W AppOps : Finishing op nesting under-run: uid 10143 pkg com.hhs2 code 24 time=0 duration=0 nesting=0 05-02 09:03:55.598 1962 2069 I Adreno : QUALCOMM build : 26dcca9, Ibef77cadeb 05-02 09:03:55.598 1962 2069 I Adreno : Build Date : 06/16/16 05-02 09:03:55.598 1962 2069 I Adreno : OpenGL ES Shader Compiler Version: XE031.06.00.02 05-02 09:03:55.598 1962 2069 I Adreno : Local Branch : mybranch20332325 05-02 09:03:55.598 1962 2069 I Adreno : Remote Branch : quic/LA.BR.1.3.4_rb1.13 05-02 09:03:55.598 1962 2069 I Adreno : Remote Branch : NONE 05-02 09:03:55.598 1962 2069 I Adreno : Reconstruct Branch : NOTHING 05-02 09:03:55.605 1962 2069 I OpenGLRenderer: Initialized EGL, version 1.4 05-02 09:03:55.734 720 720 I MSM-irqbalance: Decided to move IRQ200 from CPU1 to CPU0 05-02 09:03:55.891 2042 2042 I wpa_supplicant: RSSI=-67, BSSID:2c:4d:54:6a:bd:74, FREQ=2437 05-02 09:03:55.893 1152 1274 D ConnectivityService: updateNetworkScore for NetworkAgentInfo [WIFI () - 125] to 60 05-02 09:03:55.988 1152 1206 W qti_sensors_hal: timestampCalc: Adjusting timestamp for rollover: 3714702059243938, 6 05-02 09:03:56.151 1152 1206 W qti_sensors_hal: timestampCalc: Adjusting timestamp for rollover: 3714702222787639, 6 05-02 09:03:56.215 571 1438 E ScannerFramework: [ScannerContextManager::GetUserContext] Context not found in valid contexts (6367) 05-02 09:03:56.225 571 883 V libimgkit: DecDeInit+ 05-02 09:03:56.225 571 883 E ScannerFramework: [ScannerContextManager::GetUserContext] Context not found in valid contexts (6367) 05-02 09:03:56.225 571 883 E ScannerFramework: [ScannerContext::RemoveDataSubscriber] Subscriber not present in subscriber list 05-02 09:03:56.225 571 883 E ScannerFramework: Transition from 1 to 1 is invalid 05-02 09:03:56.406 1152 1204 W AppOps : Finishing op nesting under-run: uid 10010 pkg com.symbol.datawedge code 24 time=0 duration=0 nesting=0 05-02 09:03:56.413 1152 1541 W AppOps : Finishing op nesting under-run: uid 10010 pkg com.symbol.datawedge code 24 time=0 duration=0 nesting=0 05-02 09:03:56.420 1152 1781 W AppOps : Finishing op nesting under-run: uid 10010 pkg com.symbol.datawedge code 24 time=0 duration=0 nesting=0 05-02 09:03:56.423 1152 1846 W AppOps : Finishing op nesting under-run: uid 10010 pkg com.symbol.datawedge code 24 time=0 duration=0 nesting=0

I was also having this issue but it seems like it's fixed for me since I updated to RN 0.44.0. Can anyone confirm this?

Can confirm. 0.44 seems to have fixed it for me too.

I have the same issue with 0.44.

+1

same issue with 0.44

Same issue, tried 0.44 then reverted to 0.42 - the same

java.lang.RuntimeException路Could not invoke WebSocketModule.connect
Raw
BaseJavaModule.java:359com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke
JavaModuleWrapper.java:136com.facebook.react.cxxbridge.JavaModuleWrapper.invoke
NativeRunnable.java:-2com.facebook.react.bridge.queue.NativeRunnable.run
Handler.java:739android.os.Handler.handleCallback
Handler.java:95android.os.Handler.dispatchMessage
MessageQueueThreadHandler.java:31com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage
Looper.java:135android.os.Looper.loop
MessageQueueThreadImpl.java:196com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run
Thread.java:818java.lang.Thread.run
Caused By: java.lang.reflect.InvocationTargetException路
Method.java:-2java.lang.reflect.Method.invoke
Method.java:372java.lang.reflect.Method.invoke
BaseJavaModule.java:345com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke
JavaModuleWrapper.java:136com.facebook.react.cxxbridge.JavaModuleWrapper.invoke
NativeRunnable.java:-2com.facebook.react.bridge.queue.NativeRunnable.run
Handler.java:739android.os.Handler.handleCallback
Handler.java:95android.os.Handler.dispatchMessage
MessageQueueThreadHandler.java:31com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage
Looper.java:135android.os.Looper.loop
MessageQueueThreadImpl.java:196com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run
Thread.java:818java.lang.Thread.run
Caused By: java.lang.OutOfMemoryError路pthread_create (1040KB stack) failed: Try again
Thread.java:-2java.lang.Thread.nativeCreate
Thread.java:1063java.lang.Thread.start
ThreadPoolExecutor.java:920java.util.concurrent.ThreadPoolExecutor.addWorker
ThreadPoolExecutor.java:1338java.util.concurrent.ThreadPoolExecutor.execute
Dispatcher.java:129okhttp3.Dispatcher.enqueue
RealCall.java:78okhttp3.RealCall.enqueue
WebSocketCall.java:109okhttp3.ws.WebSocketCall.enqueue
WebSocketModule.java:135com.facebook.react.modules.websocket.WebSocketModule.connect
Method.java:-2java.lang.reflect.Method.invoke
Method.java:372java.lang.reflect.Method.invoke
BaseJavaModule.java:345com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke
JavaModuleWrapper.java:136com.facebook.react.cxxbridge.JavaModuleWrapper.invoke
NativeRunnable.java:-2com.facebook.react.bridge.queue.NativeRunnable.run
Handler.java:739android.os.Handler.handleCallback
Handler.java:95android.os.Handler.dispatchMessage
MessageQueueThreadHandler.java:31com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage
Looper.java:135android.os.Looper.loop
MessageQueueThreadImpl.java:196com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run
Thread.java:818java.lang.Thread.run

same here, started just now, can't get past the "app:transformClassesWithDexForDebug" step when running "react-native run-android" :(
"react-native": "0.42.3"

UPDATE:
the following fixed it for me:

  1. in gradle.properties add org.gradle.jvmargs=-Xmx4608M
  2. in app/build.gradle add under your android section
    dexOptions {
        javaMaxHeapSize "4g"
    }

Similar issue. It started today without any meaningful software or hardware changes. Neither the device I'm testing in, nor the Mac I'm using to debug.

Remote debugging and live reload are enabled.

--------- beginning of crash
06-12 19:11:02.554 25323-29493/com.fox3 E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
                                                              Process: com.fox3, PID: 25323
                                                              java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again
                                                                  at java.lang.Thread.nativeCreate(Native Method)
                                                                  at java.lang.Thread.start(Thread.java:730)
                                                                  at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:941)
                                                                  at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1359)
                                                                  at okhttp3.ConnectionPool.put(ConnectionPool.java:135)
                                                                  at okhttp3.OkHttpClient$1.put(OkHttpClient.java:149)
                                                                  at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:188)
                                                                  at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:129)
                                                                  at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:98)
                                                                  at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
                                                                  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
                                                                  at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109)
                                                                  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
                                                                  at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
                                                                  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                  at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124)
                                                                  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
                                                                  at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170)
                                                                  at okhttp3.RealCall.access$100(RealCall.java:33)
                                                                  at okhttp3.RealCall$AsyncCall.execute(RealCall.java:120)
                                                                  at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
                                                                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
                                                                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
                                                                  at java.lang.Thread.run(Thread.java:761)


                                                              --------- beginning of system
06-12 19:11:02.558 1550-5197/? W/ActivityManager:   Force finishing activity com.fox3/.MainActivity
06-12 19:11:02.571 1550-12158/? I/MotoSensors: Sensorhub hal enable: 1 - 0
06-12 19:11:02.575 25323-25323/com.fox3 W/libc: pthread_create failed: couldn't allocate 1069056-bytes mapped space: Out of memory
06-12 19:11:02.575 25323-25323/com.fox3 W/art: Throwing OutOfMemoryError "pthread_create (1040KB stack) failed: Try again"
06-12 19:11:02.577 25323-25323/com.fox3 D/AndroidRuntime: Shutting down VM
06-12 19:11:02.577 25323-25323/com.fox3 I/Process: Sending signal. PID: 25323 SIG: 9
06-12 19:11:02.635 556-725/? I/SFPerfTracer:      triggers: (rate: 2:49) (11883 sw vsyncs) (0 skipped) (172:3733906 vsyncs) (174:3766023)
06-12 19:11:02.670 1550-1584/? W/ActivityManager: Failed setting process group of 25323 to 1
06-12 19:11:02.670 1550-1584/? W/System.err: java.lang.IllegalArgumentException: Given thread does not exist
06-12 19:11:02.670 1550-1584/? W/System.err:     at android.os.Process.setThreadPriority(Native Method)
06-12 19:11:02.670 1550-1584/? W/System.err:     at com.android.server.am.ActivityManagerService.applyOomAdjLocked(ActivityManagerService.java:20790)
06-12 19:11:02.670 1550-1584/? W/System.err:     at com.android.server.am.ActivityManagerService.updateOomAdjLocked(ActivityManagerService.java:21284)
06-12 19:11:02.670 1550-1584/? W/System.err:     at com.android.server.am.BroadcastQueue.processCurBroadcastLocked(BroadcastQueue.java:278)
06-12 19:11:02.670 1550-1584/? W/System.err:     at com.android.server.am.BroadcastQueue.processNextBroadcast(BroadcastQueue.java:1228)
06-12 19:11:02.670 1550-1584/? W/System.err:     at com.android.server.am.BroadcastQueue$BroadcastHandler.handleMessage(BroadcastQueue.java:173)
06-12 19:11:02.670 1550-1584/? W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
06-12 19:11:02.670 1550-1584/? W/System.err:     at android.os.Looper.loop(Looper.java:154)
06-12 19:11:02.670 1550-1584/? W/System.err:     at android.os.HandlerThread.run(HandlerThread.java:61)
06-12 19:11:02.670 1550-1584/? W/System.err:     at com.android.server.ServiceThread.run(ServiceThread.java:46)
06-12 19:11:02.674 1550-5208/? E/ActivityManager: Sending non-protected broadcast com.motorola.motocare.INTENT_TRIGGER from system 4480:com.motorola.process.system/1000 pkg com.motorola.motgeofencesvc
                                                  java.lang.Throwable
                                                      at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:18179)
                                                      at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:18779)
                                                      at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:512)
                                                      at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2905)
                                                      at android.os.Binder.execTransact(Binder.java:565)
06-12 19:11:02.687 1550-10533/? W/BroadcastQueue: Permission Denial: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.amazon.mShop.android/com.amazon.mcc.crashreporter.android.CrashReportBroadcastReceiver requires android.permission.READ_LOGS due to sender android (uid 1000)
06-12 19:11:02.706 1550-18996/? I/OpenGLRenderer: Initialized EGL, version 1.4
06-12 19:11:02.706 1550-18996/? D/OpenGLRenderer: Swap behavior 1
06-12 19:11:02.779 1550-30273/? I/ActivityManager: Process com.fox3 (pid 25323) has died
06-12 19:11:02.780 1550-30273/? D/ActivityManager: cleanUpApplicationRecord -- 25323
06-12 19:11:02.780 1550-5198/? D/GraphicsStats: Buffer count: 4
06-12 19:11:02.788 1550-4230/? W/InputDispatcher: channel 'e1bd292 com.fox3/com.fox3.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
06-12 19:11:02.788 1550-4230/? E/InputDispatcher: channel 'e1bd292 com.fox3/com.fox3.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
06-12 19:11:02.820 1550-30272/? I/WindowManager: WIN DEATH: Window{e1bd292 u0 com.fox3/com.fox3.MainActivity}
06-12 19:11:02.820 1550-30272/? W/InputDispatcher: Attempted to unregister already unregistered input channel 'e1bd292 com.fox3/com.fox3.MainActivity (server)'
06-12 19:11:02.820 1550-30272/? I/WindowManager: Destroying surface Surface(name=com.fox3/com.fox3.MainActivity) called by com.android.server.wm.WindowStateAnimator.destroySurface:2067 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:896 com.android.server.wm.WindowState.removeLocked:1457 com.android.server.wm.WindowManagerService.removeWindowInnerLocked:2531 com.android.server.wm.WindowManagerService.removeWindowLocked:2489 com.android.server.wm.WindowState$DeathRecipient.binderDied:1801 android.os.BinderProxy.sendDeathNotice:688 <bottom of call stack> 
06-12 19:11:02.849 1550-5197/? W/ActivityManager: Ignoring remove of inactive process: ProcessRecord{de99e6f 0:com.fox3/u0a277}
06-12 19:11:02.851 1550-17027/? E/ActivityManager: Sending non-protected broadcast com.motorola.motocare.INTENT_TRIGGER from system 4480:com.motorola.process.system/1000 pkg com.motorola.motgeofencesvc
                                                   java.lang.Throwable
                                                       at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:18179)
                                                       at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:18779)
                                                       at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:512)
                                                       at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2905)
                                                       at android.os.Binder.execTransact(Binder.java:565)
06-12 19:11:02.905 16171-16171/? E/FullInputEventModel: onStartInput event aborted: com.touchtype.keyboard.e.am: could not obtain extracted text (class com.touchtype.keyboard.e.am)

This issue seems to come and go. Can't really find what is that magic star alignment that is causing it. I had that issue in 0.42 a couple of times and then it kind of fixed it itself. Now I have it again with 0.45.1.

@projoneftw your solution doesn't work for me unfortunately

In our company we develop numbers of APPs at the same time. We found that if a phone has installed many DEBUG version of APPs of ours, then it is likely to cause OOM.

I guess that there are memory leaks in okhttp(especially when fetching bundle) that fill the heap and then cause OOM.

Just set up a new react native android project, the moment I turn on remote debugging and then do R R - the app crashes. Followed react native android guide, I'm on Macbook Pro Sierra, Android Studio 2.3.3, "react": "16.0.0-alpha.12", "react-native": "0.45.1"

For those stuck, as a workaround you could launch another emulator

on iOS: react-native run-ios --simulator="iPhone 5"

same error here, with version 0.44.2 and okhttp 3.4.1:

Precondition: opening 'debug js remotely' on real device and enable 'live&hot reloading', wait for about 1min, app exit.

 W/unknown:PackagerConnectionSettings: You seem to be running on device. Run 'adb reverse tcp:8081 tcp:8081' to forward the debug server's port to the device.
 I/art: Background sticky concurrent mark sweep GC freed 140140(15MB) AllocSpace objects, 0(0B) LOS objects, 18% free, 35MB/43MB, paused 6.735ms total 91.432ms
 I/art: Background sticky concurrent mark sweep GC freed 71161(7MB) AllocSpace objects, 0(0B) LOS objects, 17% free, 35MB/43MB, paused 8.405ms total 78.537ms
 I/art: Background partial concurrent mark sweep GC freed 98257(8MB) AllocSpace objects, 0(0B) LOS objects, 31% free, 35MB/51MB, paused 5.786ms total 158.775ms
 W/unknown:PackagerConnectionSettings: You seem to be running on device. Run 'adb reverse tcp:8081 tcp:8081' to forward the debug server's port to the device.
 I/art: Background sticky concurrent mark sweep GC freed 123279(15MB) AllocSpace objects, 0(0B) LOS objects, 18% free, 36MB/44MB, paused 15.537ms total 171.116ms
 I/art: Background partial concurrent mark sweep GC freed 88703(8MB) AllocSpace objects, 1(213KB) LOS objects, 31% free, 35MB/51MB, paused 8.362ms total 127.585ms
 W/unknown:PackagerConnectionSettings: You seem to be running on device. Run 'adb reverse tcp:8081 tcp:8081' to forward the debug server's port to the device.
 W/libc: pthread_create failed: couldn't allocate 1064960-byte stack: Out of memory
 E/art: Throwing OutOfMemoryError "pthread_create (1040KB stack) failed: Try again"
 E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
        Process: , PID: 13798
        java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again
            at java.lang.Thread.nativeCreate(Native Method)
            at java.lang.Thread.start(Thread.java:1063)
            at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:920)
            at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1338)
            at okhttp3.ConnectionPool.put(ConnectionPool.java:135)
            at okhttp3.OkHttpClient$1.put(OkHttpClient.java:149)
            at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:188)
            at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:129)
            at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:98)
            at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
            at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
            at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
            at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109)
            at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
            at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
            at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
            at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
            at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124)
            at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
            at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
            at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170)
            at okhttp3.RealCall.access$100(RealCall.java:33)
            at okhttp3.RealCall$AsyncCall.execute(RealCall.java:120)
            at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)
 W/libc: pthread_create failed: couldn't allocate 1064960-byte stack: Out of memory
 E/art: Throwing OutOfMemoryError "pthread_create (1040KB stack) failed: Try again"
 W/libc: pthread_create failed: couldn't allocate 1064960-byte stack: Out of memory
 E/art: Throwing OutOfMemoryError "pthread_create (1040KB stack) failed: Try again"
 W/libc: pthread_create failed: couldn't allocate 1064960-byte stack: Out of memory
 E/art: Throwing OutOfMemoryError "pthread_create (1040KB stack) failed: Try again"
 I/Process: Sending signal. PID: 13798 SIG: 9

I'm getting this issue with 0.48.2. App closes immediately when debug mode is enable. I didn't have such problem before the update from 0.46

My app runs fine with the debugger off and crashes consistently, always at different times, in the first few seconds after launching it, when remote debugging is turned on. Seems odd that there is no response from the RN team with this issue being so prevalent.

Also getting this issue with Genymotion Emulator. I've tried various Android versions. As above, only when remote debugging.

Same problem here with RN 0.45.1 using Genymotion and debugger on:

10-16 03:07:01.568  4790  5101 E AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
10-16 03:07:01.568  4790  5101 E AndroidRuntime: Process: br.com.luvbook.app, PID: 4790
10-16 03:07:01.568  4790  5101 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 158590860 byte allocation with 16753120 free bytes and 103MB until OOM
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:95)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:125)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at java.lang.StringBuilder.append(StringBuilder.java:271)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at android.util.JsonReader.nextString(JsonReader.java:901)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at android.util.JsonReader.nextValue(JsonReader.java:708)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at android.util.JsonReader.objectValue(JsonReader.java:691)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at android.util.JsonReader.peek(JsonReader.java:347)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at com.facebook.react.devsupport.JSDebuggerWebSocketClient.onMessage(JSDebuggerWebSocketClient.java:198)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at okhttp3.internal.ws.RealWebSocket$1.onMessage(RealWebSocket.java:62)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at okhttp3.internal.ws.WebSocketReader.readMessageFrame(WebSocketReader.java:242)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:108)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at okhttp3.internal.ws.RealWebSocket.readMessage(RealWebSocket.java:97)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at okhttp3.ws.WebSocketCall.createWebSocket(WebSocketCall.java:152)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at okhttp3.ws.WebSocketCall.access$000(WebSocketCall.java:41)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at okhttp3.ws.WebSocketCall$1.onResponse(WebSocketCall.java:97)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at okhttp3.RealCall$AsyncCall.execute(RealCall.java:126)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
10-16 03:07:01.568  4790  5101 E AndroidRuntime:    at java.lang.Thread.run(Thread.java:818)
10-16 03:07:01.592   363   363 E EGL_emulation: tid 363: eglCreateSyncKHR(1215): error 0x3004 (EGL_BAD_ATTRIBUTE)
10-16 03:07:02.397  4790  4818 E Surface : getSlotFromBufferLocked: unknown buffer: 0xf2cb6050
10-16 03:07:04.644   677   739 E Surface : getSlotFromBufferLocked: unknown buffer: 0xe8f59540

Did you find what causes problem?

Hi, i'm having the same on Android with latest react-native 0.50.3 and React 16.0.0
I'm not sure about the root caused yet. Please suggest!

11-28 02:45:37.507 3466-3481/com.mstore I/art: Clamp target GC heap from 104MB to 96MB
11-28 02:45:41.316 3466-3604/com.mstore I/art: WaitForGcToComplete blocked for 6.753ms for cause Alloc
11-28 02:45:41.711 3466-3481/com.mstore I/art: Clamp target GC heap from 103MB to 96MB
11-28 02:45:41.891 3466-3481/com.mstore I/art: Clamp target GC heap from 111MB to 96MB
11-28 02:45:41.891 3466-3604/com.mstore I/art: WaitForGcToComplete blocked for 6.927ms for cause Alloc
11-28 02:45:41.903 3466-3604/com.mstore I/art: Clamp target GC heap from 111MB to 96MB
11-28 02:45:41.903 3466-3604/com.mstore I/art: Alloc partial concurrent mark sweep GC freed 6(192B) AllocSpace objects, 0(0B) LOS objects, 0% free, 95MB/96MB, paused 281us total 9.060ms
11-28 02:45:41.913 3466-3604/com.mstore I/art: Clamp target GC heap from 111MB to 96MB
11-28 02:45:41.913 3466-3604/com.mstore I/art: Alloc concurrent mark sweep GC freed 6(12KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 95MB/96MB, paused 191us total 10.058ms
11-28 02:45:41.913 3466-3481/com.mstore I/art: WaitForGcToComplete blocked for 18.782ms for cause Background
11-28 02:45:41.923 3466-3481/com.mstore I/art: Clamp target GC heap from 111MB to 96MB
11-28 02:45:41.933 3466-3481/com.mstore I/art: Clamp target GC heap from 111MB to 96MB
11-28 02:45:41.933 3466-3604/com.mstore I/art: WaitForGcToComplete blocked for 20.025ms for cause Alloc
11-28 02:45:41.946 3466-3604/com.mstore I/art: Clamp target GC heap from 111MB to 96MB
11-28 02:45:41.946 3466-3604/com.mstore I/art: Alloc partial concurrent mark sweep GC freed 4(128B) AllocSpace objects, 0(0B) LOS objects, 0% free, 95MB/96MB, paused 261us total 11.722ms
11-28 02:45:41.958 3466-3604/com.mstore I/art: Clamp target GC heap from 111MB to 96MB
11-28 02:45:41.958 3466-3604/com.mstore I/art: Alloc concurrent mark sweep GC freed 7(192B) AllocSpace objects, 0(0B) LOS objects, 0% free, 95MB/96MB, paused 383us total 11.338ms
11-28 02:45:41.958 3466-3604/com.mstore I/art: Forcing collection of SoftReferences for 8KB allocation
11-28 02:45:41.969 3466-3604/com.mstore I/art: Clamp target GC heap from 111MB to 96MB
11-28 02:45:41.969 3466-3604/com.mstore I/art: Alloc concurrent mark sweep GC freed 3(96B) AllocSpace objects, 0(0B) LOS objects, 0% free, 95MB/96MB, paused 345us total 10.626ms
11-28 02:45:41.969 3466-3604/com.mstore E/art: Throwing OutOfMemoryError "Failed to allocate a 8204 byte allocation with 8136 free bytes and 7KB until OOM"
11-28 02:45:41.969 3466-3481/com.mstore I/art: WaitForGcToComplete blocked for 33.503ms for cause Background
11-28 02:45:41.986 3466-3604/com.mstore I/art: WaitForGcToComplete blocked for 16.720ms for cause Alloc
11-28 02:45:41.986 3466-3604/com.mstore E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
Process: com.mstore, PID: 3466
java.lang.OutOfMemoryError: Failed to allocate a 8204 byte allocation with 8136 free bytes and 7KB until OOM
at okio.Segment.(Segment.java:63)
at okio.SegmentPool.take(SegmentPool.java:48)
at okio.Buffer.writableSegment(Buffer.java:1163)
at okio.Okio$2.read(Okio.java:137)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
at okio.RealBufferedSource.read(RealBufferedSource.java:46)
at okhttp3.internal.ws.WebSocketReader.readMessage(WebSocketReader.java:270)
at okhttp3.internal.ws.WebSocketReader.readMessageFrame(WebSocketReader.java:219)
at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:101)
at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.java:262)
at okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:201)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:135)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
11-28 02:45:41.986 3466-3662/com.mstore I/art: WaitForGcToComplete blocked for 16.384ms for cause Alloc
11-28 02:45:41.987 1661-2022/system_process W/ActivityManager: Force finishing activity com.mstore/.MainActivity

I achieve a similar OOM situation to @minhcasi from react-native-fcm/Firebase after force-closing then restarting the Android app. Perhaps related? https://github.com/evollu/react-native-fcm/issues/621

@coreform Yes, I think they are related. I have payed weeks for the OOM issue.

In my case the app runs just fine with the debugger turned off. The same as @rolgalan comment

Same here. My app might work for a while after turning on the remote debugger, however any livereload (because I changed and saved some file) has a big chance to break it. "Unfortunately the APP has stopped." After trying to run the application again on emulator it fails again, until I try like 3-4 times.
I'm not getting any errors in terminal and run-android is still running.

OS: Ubuntu 17.10
RN: 0.50.3 ejected
Here are my dependencies
    "moment": "^2.19.3",
    "react": "16.0.0",
    "react-native": "0.50.3",
    "react-native-animatable": "^1.2.4",
    "react-native-ble-plx": "^0.7.0",
    "react-native-confirmation-code-input": "^1.0.4",
    "react-native-css": "^2.1.2",
    "react-native-dotenv": "^0.1.0",
    "react-native-popup-dialog": "^0.10.43",
    "react-native-qrcode": "^0.2.6",
    "react-native-svg": "^6.0.1-rc.1",
    "react-native-vector-icons": "^4.4.2",
    "react-redux": "^5.0.6",
    "redux": "^3.7.2",
    "redux-thunk": "^2.2.0",
    "styled-components": "^2.2.4"

i get this error E/MPlugin: Unsupported class: com.mediatek.common.telephony.IOnlyOwnerSimSupport

Anybody deal with this problem?

It's a workaround, but I found that the problem went away if I switched to the standalone RN Debugger instead of Chrome: https://github.com/jhen0409/react-native-debugger.

Plus it has a few other advantages, like being able to use the network tab.

This feature has become a magnet for any Android OutOfMemory error. I'll close it in favor of opening new issues that track specific, reproducible OOMs.

Was this page helpful?
0 / 5 - 0 ratings