jgilfelt / chuck

An in-app HTTP inspector for Android OkHttp clients

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

droidluv opened this issue · comments

Large body data should be ignored and a simple string should be given instead

Got the same issue.
Here's the stacktrace:

E/FATAL EXCEPTION: Happened on thread: Thread[OkHttp Dispatcher,5,main]
                                                                              java.lang.OutOfMemoryError: Failed to allocate a 8208 byte allocation with 1416 free bytes and 1416B until OOM, max allowed footprint 201326592, growth limit 201326592
                                                                                  at okio.Segment.<init>(Segment.java:63)
                                                                                  at okio.SegmentPool.take(SegmentPool.java:48)
                                                                                  at okio.Buffer.writableSegment(Buffer.java:1169)
                                                                                  at okio.Okio$2.read(Okio.java:137)
                                                                                  at okio.Buffer.writeAll(Buffer.java:1005)
                                                                                  at okhttp3.RequestBody$3.writeTo(RequestBody.java:120)
                                                                                  at com.readystatesoftware.chuck.ChuckInterceptor.intercept(ChuckInterceptor.java:154)
                                                                                  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
                                                                                  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
                                                                                  at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:212)
                                                                                  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
                                                                                  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
                                                                                  at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
                                                                                  at okhttp3.RealCall$AsyncCall.execute(RealCall.java:147)
                                                                                  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)
commented

me to