Status Update
Comments
ra...@google.com <ra...@google.com>
sh...@google.com <sh...@google.com> #2
This functionality was released in benchmark 1.2.0-alpha06:
You'll need to use an Android 13 (API 33) emulator, and androidx.benchmark:benchmark-macro-junit4:1.2.0-alpha06
, which removes the requirement for root, and thus works on Play emulator images.
ma...@gmail.com <ma...@gmail.com> #3
Could the bug be with the recording? Several seconds of recording shouldn't generate 500MB file.
ad...@google.com <ad...@google.com> #4
There is a lot happening in these several seconds. I am not surprised there is a lot of data generated. Perfetto UI traces are more than 100MB for the same thing.
It would be nice if the IDE failed more gracefully and would not require a restart on this error.
ma...@gmail.com <ma...@gmail.com> #5
Ah thanks for the explanation. I guess then the only good way of handling this would be streaming data from disk instead of loading it completely into memory?
sh...@google.com <sh...@google.com> #6
It's possible to stream the file from the device to the laptop, so the error message "RESOURCE_EXHAUSTED: gRPC message exceeds maximum size" as in
However, to process and render a large trace file is more complicated. I agree with the idea of "streaming data from disk instead of loading it completely into memory", but it requires an extensive refactoring/rewriting of the existing Profiler code. Therefore, a more feasible immediate solution is to increase the IDE's memory (as discussed in
Description
####################################################
Please provide all of the following information, otherwise we may not be able to route your bug report.
####################################################
1. Describe the bug or issue that you're seeing.
I am trying to profile googlesearchapp in standalone profiler: /opt/android-studio-with-blaze-stable/bin/profiler.sh
In the profiler I attach to the instrumented process and start recording Java/Kotlin Method trace. I issue one query in the googlesearchapp. Click stop recording (Button with text "Stop" not button with red square)
I get an exception in the console (see below). After that nothing happens. It seems like the recording continues. There is no reaction to pressing Stop button again.
```
2024-03-06 19:56:07,789 [ 144496] SEVERE - com.android.tools.idea.io.grpc.internal.SerializingExecutor - Exception while executing runnable com.android.tools.idea.io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed@26750fc4
com.android.tools.idea.io.grpc.StatusRuntimeException: RESOURCE_EXHAUSTED: gRPC message exceeds maximum size 536870911: 560669801
at com.android.tools.idea.io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262)
at com.android.tools.idea.io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243)
at com.android.tools.idea.io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156)
at com.android.tools.profiler.proto.TransportServiceGrpc$TransportServiceBlockingStub.getBytes(TransportServiceGrpc.java:752)
at com.android.tools.idea.transport.TransportServiceProxy.getBytes(TransportServiceProxy.kt:182)
at com.android.tools.idea.transport.TransportServiceProxy$getServiceDefinition$overrides$5.invoke(TransportServiceProxy.kt:257)
at com.android.tools.idea.transport.TransportServiceProxy$getServiceDefinition$overrides$5.invoke(TransportServiceProxy.kt:257)
at com.android.tools.idea.transport.TransportServiceProxyKt$sam$com_android_tools_idea_io_grpc_stub_ServerCalls_UnaryMethod$0.invoke(TransportServiceProxy.kt)
at com.android.tools.idea.io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:182)
at com.android.tools.idea.io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:340)
at com.android.tools.idea.io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:866)
at com.android.tools.idea.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at com.android.tools.idea.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
2024-03-06 19:56:07,789 [ 144496] SEVERE - com.android.tools.idea.io.grpc.internal.SerializeReentrantCallsDirectExecutor - Exception while executing runnable com.android.tools.idea.io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed@5bd95572
com.android.tools.idea.io.grpc.StatusRuntimeException: UNKNOWN
at com.android.tools.idea.io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262)
at com.android.tools.idea.io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243)
at com.android.tools.idea.io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156)
at com.android.tools.profiler.proto.TransportServiceGrpc$TransportServiceBlockingStub.getBytes(TransportServiceGrpc.java:752)
at com.android.tools.datastore.service.TransportService.getBytes(TransportService.java:206)
at com.android.tools.profiler.proto.TransportServiceGrpc$MethodHandlers.invoke(TransportServiceGrpc.java:1006)
at com.android.tools.idea.io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:182)
at com.android.tools.idea.io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:340)
at com.android.tools.idea.io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:866)
at com.android.tools.idea.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at com.android.tools.idea.io.grpc.internal.SerializeReentrantCallsDirectExecutor.execute(SerializeReentrantCallsDirectExecutor.java:49)
at com.android.tools.idea.io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener.halfClosed(ServerImpl.java:877)
at com.android.tools.idea.io.grpc.inprocess.InProcessTransport$InProcessStream$InProcessClientStream.halfClose(InProcessTransport.java:800)
at com.android.tools.idea.io.grpc.internal.ForwardingClientStream.halfClose(ForwardingClientStream.java:72)
at com.android.tools.idea.io.grpc.internal.RetriableStream$1HalfCloseEntry.runWith(RetriableStream.java:658)
at com.android.tools.idea.io.grpc.internal.RetriableStream.delayOrExecute(RetriableStream.java:529)
at com.android.tools.idea.io.grpc.internal.RetriableStream.halfClose(RetriableStream.java:662)
at com.android.tools.idea.io.grpc.internal.ClientCallImpl.halfCloseInternal(ClientCallImpl.java:499)
at com.android.tools.idea.io.grpc.internal.ClientCallImpl.halfClose(ClientCallImpl.java:488)
at com.android.tools.idea.io.grpc.stub.ClientCalls.asyncUnaryRequestCall(ClientCalls.java:309)
at com.android.tools.idea.io.grpc.stub.ClientCalls.futureUnaryCall(ClientCalls.java:218)
at com.android.tools.idea.io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:146)
at com.android.tools.profiler.proto.TransportServiceGrpc$TransportServiceBlockingStub.getBytes(TransportServiceGrpc.java:752)
at com.android.tools.profilers.cpu.CpuCaptureStage.getAndSaveCapture(CpuCaptureStage.java:170)
at com.android.tools.profilers.cpu.CpuCaptureStage.create(CpuCaptureStage.java:226)
at com.android.tools.profilers.cpu.CpuProfilerStage.goToCaptureStage(CpuProfilerStage.java:456)
at com.android.tools.profilers.cpu.CpuProfilerStage.setAndSelectCapture(CpuProfilerStage.java:496)
at com.android.tools.profilers.cpu.CpuProfilerStage$InProgressTraceHandler.update(CpuProfilerStage.java:654)
at com.android.tools.adtui.model.updater.Updater.lambda$onTick$0(Updater.java:103)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at com.android.tools.adtui.model.updater.Updater.onTick(Updater.java:103)
at com.android.tools.adtui.model.StopwatchTimer.tick(StopwatchTimer.java:55)
at com.android.tools.adtui.model.FpsTimer.actionPerformed(FpsTimer.java:73)
at java.desktop/javax.swing.Timer.fireActionPerformed(Timer.java:311)
at java.desktop/javax.swing.Timer$DoPostEvent.run(Timer.java:243)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:789)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:740)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:734)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:759)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:667)
at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$7(IdeEventQueue.kt:571)
at com.intellij.openapi.application.impl.ApplicationImpl.withoutImplicitRead(ApplicationImpl.java:1444)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:571)
at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:68)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:349)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:348)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:348)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:343)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:995)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:995)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$4(IdeEventQueue.kt:343)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:829)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:385)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
2024-03-06 19:56:07,792 [ 144499] SEVERE - #c.i.i.p.PluginManager - UNKNOWN
com.android.tools.idea.io.grpc.StatusRuntimeException: UNKNOWN
at com.android.tools.idea.io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262)
at com.android.tools.idea.io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243)
at com.android.tools.idea.io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156)
at com.android.tools.profiler.proto.TransportServiceGrpc$TransportServiceBlockingStub.getBytes(TransportServiceGrpc.java:752)
at com.android.tools.profilers.cpu.CpuCaptureStage.getAndSaveCapture(CpuCaptureStage.java:170)
at com.android.tools.profilers.cpu.CpuCaptureStage.create(CpuCaptureStage.java:226)
at com.android.tools.profilers.cpu.CpuProfilerStage.goToCaptureStage(CpuProfilerStage.java:456)
at com.android.tools.profilers.cpu.CpuProfilerStage.setAndSelectCapture(CpuProfilerStage.java:496)
at com.android.tools.profilers.cpu.CpuProfilerStage$InProgressTraceHandler.update(CpuProfilerStage.java:654)
at com.android.tools.adtui.model.updater.Updater.lambda$onTick$0(Updater.java:103)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at com.android.tools.adtui.model.updater.Updater.onTick(Updater.java:103)
at com.android.tools.adtui.model.StopwatchTimer.tick(StopwatchTimer.java:55)
at com.android.tools.adtui.model.FpsTimer.actionPerformed(FpsTimer.java:73)
at java.desktop/javax.swing.Timer.fireActionPerformed(Timer.java:311)
at java.desktop/javax.swing.Timer$DoPostEvent.run(Timer.java:243)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:789)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:740)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:734)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:759)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:667)
at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$7(IdeEventQueue.kt:571)
at com.intellij.openapi.application.impl.ApplicationImpl.withoutImplicitRead(ApplicationImpl.java:1444)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:571)
at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:68)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:349)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:348)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:348)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:343)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:995)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:995)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$4(IdeEventQueue.kt:343)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:829)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:385)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
2024-03-06 19:56:07,793 [ 144500] SEVERE - #c.i.i.p.PluginManager - Android Studio Game Tools dev build Build #AI-231.9392.1.2311.11330709
2024-03-06 19:56:07,793 [ 144500] SEVERE - #c.i.i.p.PluginManager - JDK: 17.0.7; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2024-03-06 19:56:07,793 [ 144500] SEVERE - #c.i.i.p.PluginManager - OS: Linux
```
This is what I found on the phone:
```
adb shell
raven:/ $ cd /data/local/tmp/perfd/
raven:/data/local/tmp/perfd $ ls
agent.config arm64 daemon.config libjvmtiagent_arm64.so perfa_okhttp.dex perfetto_arm64 simpleperf_arm64 traced_arm64 traced_probes_arm64
arm cache libjvmtiagent_arm.so perfa.jar perfetto_arm simpleperf_arm traced_arm traced_probes_arm transport
raven:/data/local/tmp/perfd $ cd cache/
raven:/data/local/tmp/perfd/cache $ ls
complete partial
raven:/data/local/tmp/perfd/cache $ cd complete/
raven:/data/local/tmp/perfd/cache/complete $ ls -al
total 548078
drwxrwxrwx 2 shell shell 3452 2024-03-06 19:56 .
drwxrwxrwx 4 shell shell 3452 2024-03-06 19:54 ..
-rwxrwx--- 1 shell shell 560669795 2024-03-06 19:56 11621704317278
```
The cache has size of 560669795.
2. Attach log files from Android Studio
2A. In the IDE, select the Help..Collect Logs and Diagnostic Data menu option.
2B. Create a diagnostic report and save it to your local computer.
2C. Attach the report to this bug using the Add attachments button.
3. If you know what they are, write the steps to reproduce:
In the profiler I attach to the instrumented googlesearchapp process and start recording Java/Kotlin Method trace. I issue one query in the googlesearchapp on the phone. Right after that I click stop recording (Button with text "Stop" not the button with red square)
I get an exception in the console (see below). After that nothing happens. It seems like the recording continues. There is no reaction to pressing Stop button again. Profiler/IDE has to be restarted after that to make it work again.
In addition to logs, please attach a screenshot or recording that illustrates the problem.
For more information on how to get your bug routed quickly, see
Build: AI-231.9392.1.2311.11330709, 202401181853
AI-231.9392.1.2311.11330709, JRE 17.0.7+0-17.0.7b1000.6-10550314x64 JetBrains s.r.o., OS Linux(amd64) v6.5.13-1rodete2-amd64, screens 3008.0x1668.0
AS: Hedgehog | 2023.1.1 Patch 2
Kotlin plugin: 231-1.9.22-release-704-AS9392.1.2311.11330709
Android Gradle Plugin: (plugin information not found)
Gradle: (gradle version information not found)
Gradle JDK: JetBrains Runtime version 17.0.7
NDK: from local.properties: (not specified), latest from SDK: (not found)
CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
Source: send_feedback_icon```