-3

There are so many questions with the same type of this error but I am not able to find the solution for my error, I checked on my diffrent devices but still not able to find exactly where this error occurs. My app is live currently and installed on 50k active devices, I got this error through my firebase and it occurs so many times.

 Exception java.lang.OutOfMemoryError: Failed to allocate a 65548 byte allocation with 55872 free bytes and 54KB until OOM
com.android.okhttp.okio.Segment.<init> (Segment.java:62)
com.android.okhttp.okio.SegmentPool.take (SegmentPool.java:46)
com.android.okhttp.okio.Buffer.writableSegment (Buffer.java:1114)
com.android.okhttp.okio.InflaterSource.read (InflaterSource.java:66)
com.android.okhttp.okio.GzipSource.read (GzipSource.java:80)
com.android.okhttp.okio.RealBufferedSource$1.read (RealBufferedSource.java:374)
bmr.a (:com.google.android.gms.DynamiteModulesC:95)
bmk.a (:com.google.android.gms.DynamiteModulesC:1055)
bmq.a (:com.google.android.gms.DynamiteModulesC:5055)
bmq.run (:com.google.android.gms.DynamiteModulesC:54)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1113)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:588)
java.lang.Thread.run (Thread.java:818)
Ahmed
  • 98
  • 2
  • 10
  • 1
    You ran out of memory. There's no way to tell from the stack trace what caused it, because its a cumulative problem. You need to run the app and take some heap dumps, look for memory leaks. – Gabe Sechan Apr 24 '17 at 00:57
  • Please paste the code of the activity where you are getting this error – Sonam Apr 24 '17 at 05:45

3 Answers3

1

It seems that you have tried to upload file by "okhttp".If it is,try to use a "Filepath" instead of "File" as a param.

Qian Sijianhao
  • 564
  • 7
  • 19
  • I am downloading the image and video file in catches folder, i will check your solution and give you the reply. – Ahmed Apr 25 '17 at 00:22
  • Yeah, actually I am transferring the object with an interface which contains bitmaps, files, etc.I think that is the problem – Ahmed Apr 25 '17 at 00:27
  • I once had a similar problem when uploading file with asynchttp.Finally I found that if I do uploading with File object , the whole file with be cached in byte[] and that may cause a OOM. But if I use a String filepath , then the file will be read part by part. – Qian Sijianhao Apr 25 '17 at 01:41
0

Seems like you try to unzip a large file, a file so large that all the device's memory is spent. Available memory is different on each device. If possible, try to split the file into smaller chunks and handle them individually. Otherwize, try to use a streaming solution where you can unzip using a stream instead of loading the entire file into memory before starting the unzip.

Try this: Unzip using a stream or read documentation here: GZUPInputStream

Community
  • 1
  • 1
DKIT
  • 3,471
  • 2
  • 20
  • 24
0

just remove HttpLoggingInterceptor.Level.BODY

ayoub laaziz
  • 1,196
  • 9
  • 12