Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Throwing OutOfMemoryError crash #9665

Closed
ansmonjol opened this issue Aug 30, 2016 · 57 comments
Closed

Android Throwing OutOfMemoryError crash #9665

ansmonjol opened this issue Aug 30, 2016 · 57 comments
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@ansmonjol
Copy link

ansmonjol commented Aug 30, 2016

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

@marcshilling
Copy link

marcshilling commented Sep 2, 2016

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

@maximeaubaret
Copy link

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

@rolgalan
Copy link

rolgalan commented Sep 8, 2016

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.

@fab1an
Copy link

fab1an commented Sep 9, 2016

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.

@compojoom
Copy link
Contributor

compojoom commented Sep 25, 2016

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
Copy link

fab1an commented Sep 25, 2016

Please analyze your memory, here's a guide on how to do that: https://developer.android.com/studio/profile/am-memory.html

https://developer.android.com/studio/profile/am-hprof.html

@compojoom
Copy link
Contributor

compojoom commented Sep 26, 2016

@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...

@fab1an
Copy link

fab1an commented Sep 26, 2016

@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.

@compojoom
Copy link
Contributor

@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?

@fab1an
Copy link

fab1an commented Sep 26, 2016

@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
Copy link

fab1an commented Sep 26, 2016

@compojoom Check out: #8677 (comment)

@compojoom
Copy link
Contributor

@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?

@fab1an
Copy link

fab1an commented Sep 27, 2016

@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.

@compojoom
Copy link
Contributor

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?

@fab1an
Copy link

fab1an commented Sep 27, 2016

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

@compojoom
Copy link
Contributor

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.

@compojoom
Copy link
Contributor

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.

@itinance
Copy link
Contributor

Any news on this?

@itinance
Copy link
Contributor

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

@chris-pikul
Copy link

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?

@martsie
Copy link

martsie commented Jan 23, 2017

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.

@rodperottoni
Copy link

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

@pocesar
Copy link

pocesar commented Mar 17, 2017

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

@jorrit-g
Copy link

jorrit-g commented Mar 19, 2017

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

@n1ru4l
Copy link
Contributor

n1ru4l commented Mar 27, 2017

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

@markusguenther
Copy link

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.

@sahir
Copy link

sahir commented Apr 19, 2017

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

@iremlopsum
Copy link

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

@wzpan
Copy link

wzpan commented Jun 20, 2017

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.

@nodkrot
Copy link

nodkrot commented Jun 28, 2017

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"

@aschenkel
Copy link

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

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

@sduqlsc
Copy link

sduqlsc commented Aug 22, 2017

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

@laukaichung
Copy link

laukaichung commented Sep 9, 2017

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

@agersoncgps
Copy link

agersoncgps commented Sep 24, 2017

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.

@trickeyd
Copy link

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

@lucianomlima
Copy link
Contributor

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

@kesha-antonov
Copy link
Contributor

Did you find what causes problem?

@minhcasi
Copy link

minhcasi commented Nov 29, 2017

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

@coreform
Copy link

coreform commented Dec 6, 2017

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

@lhfiii
Copy link

lhfiii commented Dec 6, 2017

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

@jqn
Copy link

jqn commented Dec 6, 2017

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

@ppozniak
Copy link

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"

@rajeshzmoke
Copy link

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

@jy626760171
Copy link

Anybody deal with this problem?

@adamshone
Copy link

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.

@facebook facebook deleted a comment from jy626760171 Mar 12, 2018
@react-native-bot react-native-bot added Android Ran Commands One of our bots successfully processed a command. labels Mar 18, 2018
@react-native-bot react-native-bot added Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. labels Mar 18, 2018
@hramos
Copy link
Contributor

hramos commented Mar 20, 2018

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.

@hramos hramos closed this as completed Mar 20, 2018
@facebook facebook locked as off-topic and limited conversation to collaborators Mar 20, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Dec 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests