ListBuddies icon indicating copy to clipboard operation
ListBuddies copied to clipboard

Memory Issue Samsung devices

Open antoniomadrigal10 opened this issue 10 years ago • 4 comments

I have an issue on samsung devices, i get the this error when start using the library and this only happens on S4 and S3, i have tested on Nexus 4 and Xperia L1 without this error?

could you help me please!!

08-27 13:11:48.045: E/dalvikvm-heap(21470): Out of memory on a 1684-byte allocation. 08-27 13:11:48.050: I/dalvikvm(21470): "main" prio=5 tid=1 RUNNABLE 08-27 13:11:48.050: I/dalvikvm(21470): | group="main" sCount=0 dsCount=0 obj=0x41d20578 self=0x41c456a8 08-27 13:11:48.050: I/dalvikvm(21470): | sysTid=21470 nice=0 sched=0/0 cgrp=apps handle=1074466812 08-27 13:11:48.050: I/dalvikvm(21470): | state=R schedstat=( 37714548370 2517839095 71736 ) utm=3554 stm=216 core=3 08-27 13:11:48.050: I/dalvikvm(21470): at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:~94) 08-27 13:11:48.050: I/dalvikvm(21470): at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:124) 08-27 13:11:48.050: I/dalvikvm(21470): at java.lang.StringBuffer.append(StringBuffer.java:278) 08-27 13:11:48.050: I/dalvikvm(21470): at java.io.StringWriter.write(StringWriter.java:123) 08-27 13:11:48.050: I/dalvikvm(21470): at java.io.PrintWriter.doWrite(PrintWriter.java:623) 08-27 13:11:48.050: I/dalvikvm(21470): at java.io.PrintWriter.write(PrintWriter.java:601) 08-27 13:11:48.050: I/dalvikvm(21470): at java.io.PrintWriter.write(PrintWriter.java:579) 08-27 13:11:48.050: I/dalvikvm(21470): at java.io.PrintWriter.write(PrintWriter.java:660) 08-27 13:11:48.050: I/dalvikvm(21470): at java.io.PrintWriter.append(PrintWriter.java:722) 08-27 13:11:48.050: I/dalvikvm(21470): at java.io.PrintWriter.append(PrintWriter.java:691) 08-27 13:11:48.050: I/dalvikvm(21470): at java.io.PrintWriter.append(PrintWriter.java:31) 08-27 13:11:48.050: I/dalvikvm(21470): at java.lang.Throwable.printStackTrace(Throwable.java:330) 08-27 13:11:48.050: I/dalvikvm(21470): at java.lang.Throwable.printStackTrace(Throwable.java:306) 08-27 13:11:48.050: I/dalvikvm(21470): at android.util.Log.getStackTraceString(Log.java:400) 08-27 13:11:48.050: I/dalvikvm(21470): at android.util.Slog.e(Slog.java:151) 08-27 13:11:48.050: I/dalvikvm(21470): at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:142) 08-27 13:11:48.050: I/dalvikvm(21470): at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693) 08-27 13:11:48.050: I/dalvikvm(21470): at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690) 08-27 13:11:48.050: I/dalvikvm(21470): at dalvik.system.NativeStart.main(Native Method) 08-27 13:11:48.050: I/Process(21470): Sending signal. PID: 21470 SIG: 9

antoniomadrigal10 avatar Aug 27 '14 18:08 antoniomadrigal10

How are you loading the images? Samsung doesn't seem to like this lib lol

jpardogo avatar Aug 28 '14 08:08 jpardogo

Im using this lib https://github.com/koush/ion to load http url images and keep them on cache!

antoniomadrigal10 avatar Aug 28 '14 15:08 antoniomadrigal10

I am not actually doing any heavy allocations with the library so I don't think the problem is library related. The Memory problems used to appear because of bitmaps allocations. Are you recycling your adapter views properly using convertView? This library should be alright but try Picasso, just in case. Investigate your memory and where allocation are taking place. If you need a reference of how ot do that , there is an old google talk that is very interesting, you can find it here

jpardogo avatar Aug 28 '14 15:08 jpardogo

This is definitely related with the issue #8 , where Samsung devices call GC_EXPLICIT. If they call GC_EXPLICIT is because they run out of memory....

jpardogo avatar Aug 28 '14 20:08 jpardogo