Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

OutOfMemory Exception when OkHttp request/response body has huge data(like a video for example) #581

Description

@LouisCAD

Hi, I'm uploading video files with an app using OkHttp, and Stetho still tries to allocate the whole video (which was more than 100MB in my case, but could be bigger) in RAM instead of setting a reasonable threshold where it'd just print the size of the request, and maybe the beginning of the request up to the max RAM consumption threshold.

Happened on thread: Thread[StethoWorker-main-730,5,main]
                                                                              java.lang.OutOfMemoryError: Failed to allocate a 8208 byte allocation with 136 free bytes and 136B until OOM, max allowed footprint 201326592, growth limit 201326592
                                                                                  at java.io.BufferedOutputStream.<init>(BufferedOutputStream.java:76)
                                                                                  at java.io.BufferedOutputStream.<init>(BufferedOutputStream.java:59)
                                                                                  at com.facebook.stetho.server.http.LightHttpServer.serve(LightHttpServer.java:46)
                                                                                  at com.facebook.stetho.inspector.DevtoolsSocketHandler.onAccepted(DevtoolsSocketHandler.java:52)
                                                                                  at com.facebook.stetho.server.ProtocolDetectingSocketHandler.onSecured(ProtocolDetectingSocketHandler.java:63)
                                                                                  at com.facebook.stetho.server.SecureSocketHandler.onAccepted(SecureSocketHandler.java:33)
                                                                                  at com.facebook.stetho.server.LazySocketHandler.onAccepted(LazySocketHandler.java:36)
                                                                                  at com.facebook.stetho.server.LocalSocketServer$WorkerThread.run(LocalSocketServer.java:167)

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions