saravanarajan / acra

Automatically exported from code.google.com/p/acra
0 stars 0 forks source link

Acra running out of memory when sending reports "java.lang.OutOfMemoryError" #91

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. No clue, its happening remotely on a phone I have no access to

What is the expected output? What do you see instead?
Don't expect an error

What version of the product are you using? On what operating system?
Android: 2.3.4
Acra 4.2.3

Please provide any additional information below.

I am getting this error a lot of times:

java.lang.OutOfMemoryError
    at org.acra.CrashReportData.load(CrashReportData.java:327)
    at org.acra.CrashReportData.load(CrashReportData.java:261)
    at org.acra.ErrorReporter.loadCrashReport(ErrorReporter.java:984)
    at org.acra.ErrorReporter.checkAndSendReports(ErrorReporter.java:959)
    at org.acra.ErrorReporter$ReportsSenderWorker.run(ErrorReporter.java:142)

and this one:

java.lang.OutOfMemoryError
    at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:154)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:225)
    at org.acra.CrashReportData.isEbcdic(CrashReportData.java:269)
    at org.acra.CrashReportData.load(CrashReportData.java:257)
    at org.acra.ErrorReporter.loadCrashReport(ErrorReporter.java:984)
    at org.acra.ErrorReporter.checkAndSendReports(ErrorReporter.java:959)
    at org.acra.ErrorReporter$ReportsSenderWorker.run(ErrorReporter.java:142)

Original issue reported on code.google.com by federico...@gmail.com on 17 Nov 2011 at 2:01

GoogleCodeExporter commented 9 years ago
java.lang.OutOfMemoryError
    at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:95)
    at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:153)
    at java.lang.StringBuilder.append(StringBuilder.java:217)
    at org.acra.util.HttpUtils.doPost(HttpUtils.java:52)
    at org.acra.sender.GoogleFormSender.send(GoogleFormSender.java:62)
    at org.acra.ErrorReporter.sendCrashReport(ErrorReporter.java:850)
    at org.acra.ErrorReporter.checkAndSendReports(ErrorReporter.java:960)
    at org.acra.ErrorReporter$ReportsSenderWorker.run(ErrorReporter.java:142)
 Same error

Original comment by federico...@gmail.com on 17 Nov 2011 at 9:46

GoogleCodeExporter commented 9 years ago
java.lang.OutOfMemoryError
    at java.io.BufferedReader.<init>(BufferedReader.java:95)
    at java.io.BufferedReader.<init>(BufferedReader.java:78)
    at org.acra.CrashReportData.load(CrashReportData.java:318)
    at org.acra.CrashReportData.load(CrashReportData.java:261)
    at org.acra.ErrorReporter.loadCrashReport(ErrorReporter.java:984)
    at org.acra.ErrorReporter.checkAndSendReports(ErrorReporter.java:959)
    at org.acra.ErrorReporter$ReportsSenderWorker.run(ErrorReporter.java:142)

Original comment by federico...@gmail.com on 22 Nov 2011 at 4:59

GoogleCodeExporter commented 9 years ago
I've seen this as well..
OS=Android-2.3.4
Phone=PG86100 (HTC Evo)
ACRA=4.3.0-2011-09-11 (snapshot)

{code}
java.lang.OutOfMemoryError: (Heap Size=24775KB, Allocated=20913KB, Bitmap 
Size=7996KB)
at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:154)
at java.io.BufferedInputStream.read(BufferedInputStream.java:324)
at java.io.InputStreamReader.read(InputStreamReader.java:255)
at java.io.BufferedReader.fillBuf(BufferedReader.java:128)
at java.io.BufferedReader.read(BufferedReader.java:236)
at org.acra.CrashReportPersister.load(CrashReportPersister.java:172)
at org.acra.CrashReportPersister.load(CrashReportPersister.java:76)
at org.acra.SendWorker.checkAndSendReports(SendWorker.java:112)
at org.acra.SendWorker.run(SendWorker.java:58)
{code}

It looks like either the BufferedReader or the BufferedInputStream that it 
wraps are allocating 8MB instead of 8KB.

Original comment by william....@gmail.com on 1 Jan 2012 at 7:15

GoogleCodeExporter commented 9 years ago
Fix (or at least mitigation) in revision#770.
Essentially I changed all BufferedStreams/Readers to have an explicit buffer 
size of 8192 bytes, based largely upon discussions at 
http://stackoverflow.com/questions/3498643/dalvik-message-default-buffer-size-us
ed-in-bufferedinputstream-constructor-it

Original comment by william....@gmail.com on 1 Jan 2012 at 7:49

GoogleCodeExporter commented 9 years ago
anyone try the new revision? ps do i have to checkout the code and build it 
myself?

Original comment by przemek...@gmail.com on 10 Jan 2012 at 1:12