Android Memory Profiler potential bug that crashed the app

Multi tool use
Multi tool use












0















My React Native app has some native implementation where I run OpenCV and Tensorflow. Without, Android Profiling, app runs smoothly and doesn't crash. With Android Profiling on, the moment the native functions are invoked, the app freezes with the following error message.



StudioProfiler: Studio Profilers encountered an unexpected error. 
Consider reporting a bug, including logcat output below.
See also: https://developer.android.com/studio/report-bugs.html#studio-bugs

Could not track an OkHttp3 request
java.io.IOException: closed
at okio.RealBufferedSink$1.write(RealBufferedSink.java:191)
at com.facebook.react.modules.network.CountingOutputStream.write(CountingOutputStream.java:53)
at com.facebook.react.modules.network.ProgressRequestBody$1.write(ProgressRequestBody.java:61)
at okio.Okio$1.write(Okio.java:79)
at okio.RealBufferedSink.flush(RealBufferedSink.java:216)
at com.facebook.react.modules.network.ProgressRequestBody.writeTo(ProgressRequestBody.java:54)
at com.android.tools.profiler.agent.okhttp.OkHttp3Interceptor.trackRequest(OkHttp3Interceptor.java:91)
at com.android.tools.profiler.agent.okhttp.OkHttp3Interceptor.intercept(OkHttp3Interceptor.java:45)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
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:93)
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:120)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:179)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:129)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)


Then, other warnings like below appear, which don't happen without a profiler.



Skipped 80 frames!  The application may be doing too much work on its main thread.









share|improve this question























  • In Android perspective "The application may be doing too much work on its main thread." is plain and simple. You need to avoid any task like DB operations or network queries doing on the main thread. As main thread is mostly used for handling UI updates and user interaction. However, This is not exactly the cause of the crash IMP

    – Killer
    Dec 28 '18 at 21:48











  • Yeah, there is no DB requests or network calls in the main thread, except maybe for the React Native rendering part. But the fact that it gets invoked only after I connect the profiler is weird

    – Jim Mirzakhalov
    Dec 28 '18 at 22:19
















0















My React Native app has some native implementation where I run OpenCV and Tensorflow. Without, Android Profiling, app runs smoothly and doesn't crash. With Android Profiling on, the moment the native functions are invoked, the app freezes with the following error message.



StudioProfiler: Studio Profilers encountered an unexpected error. 
Consider reporting a bug, including logcat output below.
See also: https://developer.android.com/studio/report-bugs.html#studio-bugs

Could not track an OkHttp3 request
java.io.IOException: closed
at okio.RealBufferedSink$1.write(RealBufferedSink.java:191)
at com.facebook.react.modules.network.CountingOutputStream.write(CountingOutputStream.java:53)
at com.facebook.react.modules.network.ProgressRequestBody$1.write(ProgressRequestBody.java:61)
at okio.Okio$1.write(Okio.java:79)
at okio.RealBufferedSink.flush(RealBufferedSink.java:216)
at com.facebook.react.modules.network.ProgressRequestBody.writeTo(ProgressRequestBody.java:54)
at com.android.tools.profiler.agent.okhttp.OkHttp3Interceptor.trackRequest(OkHttp3Interceptor.java:91)
at com.android.tools.profiler.agent.okhttp.OkHttp3Interceptor.intercept(OkHttp3Interceptor.java:45)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
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:93)
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:120)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:179)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:129)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)


Then, other warnings like below appear, which don't happen without a profiler.



Skipped 80 frames!  The application may be doing too much work on its main thread.









share|improve this question























  • In Android perspective "The application may be doing too much work on its main thread." is plain and simple. You need to avoid any task like DB operations or network queries doing on the main thread. As main thread is mostly used for handling UI updates and user interaction. However, This is not exactly the cause of the crash IMP

    – Killer
    Dec 28 '18 at 21:48











  • Yeah, there is no DB requests or network calls in the main thread, except maybe for the React Native rendering part. But the fact that it gets invoked only after I connect the profiler is weird

    – Jim Mirzakhalov
    Dec 28 '18 at 22:19














0












0








0








My React Native app has some native implementation where I run OpenCV and Tensorflow. Without, Android Profiling, app runs smoothly and doesn't crash. With Android Profiling on, the moment the native functions are invoked, the app freezes with the following error message.



StudioProfiler: Studio Profilers encountered an unexpected error. 
Consider reporting a bug, including logcat output below.
See also: https://developer.android.com/studio/report-bugs.html#studio-bugs

Could not track an OkHttp3 request
java.io.IOException: closed
at okio.RealBufferedSink$1.write(RealBufferedSink.java:191)
at com.facebook.react.modules.network.CountingOutputStream.write(CountingOutputStream.java:53)
at com.facebook.react.modules.network.ProgressRequestBody$1.write(ProgressRequestBody.java:61)
at okio.Okio$1.write(Okio.java:79)
at okio.RealBufferedSink.flush(RealBufferedSink.java:216)
at com.facebook.react.modules.network.ProgressRequestBody.writeTo(ProgressRequestBody.java:54)
at com.android.tools.profiler.agent.okhttp.OkHttp3Interceptor.trackRequest(OkHttp3Interceptor.java:91)
at com.android.tools.profiler.agent.okhttp.OkHttp3Interceptor.intercept(OkHttp3Interceptor.java:45)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
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:93)
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:120)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:179)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:129)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)


Then, other warnings like below appear, which don't happen without a profiler.



Skipped 80 frames!  The application may be doing too much work on its main thread.









share|improve this question














My React Native app has some native implementation where I run OpenCV and Tensorflow. Without, Android Profiling, app runs smoothly and doesn't crash. With Android Profiling on, the moment the native functions are invoked, the app freezes with the following error message.



StudioProfiler: Studio Profilers encountered an unexpected error. 
Consider reporting a bug, including logcat output below.
See also: https://developer.android.com/studio/report-bugs.html#studio-bugs

Could not track an OkHttp3 request
java.io.IOException: closed
at okio.RealBufferedSink$1.write(RealBufferedSink.java:191)
at com.facebook.react.modules.network.CountingOutputStream.write(CountingOutputStream.java:53)
at com.facebook.react.modules.network.ProgressRequestBody$1.write(ProgressRequestBody.java:61)
at okio.Okio$1.write(Okio.java:79)
at okio.RealBufferedSink.flush(RealBufferedSink.java:216)
at com.facebook.react.modules.network.ProgressRequestBody.writeTo(ProgressRequestBody.java:54)
at com.android.tools.profiler.agent.okhttp.OkHttp3Interceptor.trackRequest(OkHttp3Interceptor.java:91)
at com.android.tools.profiler.agent.okhttp.OkHttp3Interceptor.intercept(OkHttp3Interceptor.java:45)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
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:93)
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:120)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:179)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:129)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)


Then, other warnings like below appear, which don't happen without a profiler.



Skipped 80 frames!  The application may be doing too much work on its main thread.






android android-studio react-native android-profiler






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 28 '18 at 21:28









Jim MirzakhalovJim Mirzakhalov

2315




2315













  • In Android perspective "The application may be doing too much work on its main thread." is plain and simple. You need to avoid any task like DB operations or network queries doing on the main thread. As main thread is mostly used for handling UI updates and user interaction. However, This is not exactly the cause of the crash IMP

    – Killer
    Dec 28 '18 at 21:48











  • Yeah, there is no DB requests or network calls in the main thread, except maybe for the React Native rendering part. But the fact that it gets invoked only after I connect the profiler is weird

    – Jim Mirzakhalov
    Dec 28 '18 at 22:19



















  • In Android perspective "The application may be doing too much work on its main thread." is plain and simple. You need to avoid any task like DB operations or network queries doing on the main thread. As main thread is mostly used for handling UI updates and user interaction. However, This is not exactly the cause of the crash IMP

    – Killer
    Dec 28 '18 at 21:48











  • Yeah, there is no DB requests or network calls in the main thread, except maybe for the React Native rendering part. But the fact that it gets invoked only after I connect the profiler is weird

    – Jim Mirzakhalov
    Dec 28 '18 at 22:19

















In Android perspective "The application may be doing too much work on its main thread." is plain and simple. You need to avoid any task like DB operations or network queries doing on the main thread. As main thread is mostly used for handling UI updates and user interaction. However, This is not exactly the cause of the crash IMP

– Killer
Dec 28 '18 at 21:48





In Android perspective "The application may be doing too much work on its main thread." is plain and simple. You need to avoid any task like DB operations or network queries doing on the main thread. As main thread is mostly used for handling UI updates and user interaction. However, This is not exactly the cause of the crash IMP

– Killer
Dec 28 '18 at 21:48













Yeah, there is no DB requests or network calls in the main thread, except maybe for the React Native rendering part. But the fact that it gets invoked only after I connect the profiler is weird

– Jim Mirzakhalov
Dec 28 '18 at 22:19





Yeah, there is no DB requests or network calls in the main thread, except maybe for the React Native rendering part. But the fact that it gets invoked only after I connect the profiler is weird

– Jim Mirzakhalov
Dec 28 '18 at 22:19












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53964463%2fandroid-memory-profiler-potential-bug-that-crashed-the-app%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53964463%2fandroid-memory-profiler-potential-bug-that-crashed-the-app%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







tAi a0ADnxflyVqp8SBj49N,fRb,mnqIt
f,pg35juPUnfkdEMDN,urBP,a wNwNnMQ

Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas