Oh ok, so do I need to use something like lazy list or is there any way
that i can handle it in my code. I am using Fragment Activity and have
created two fragments and replacing them alternatively for displaying all
the images one by one.

One more thing that i don't understand is why only on 4.1.2?! I tested the
application on android 2.3.3, 4.0.3, 4.0.4, 4.1.1, 4.2, also on different
devices with lower and higher processors, i.e. samsung galaxy s plus,
galaxy s2, sony xperia tipo, samsung galaxy tab 7 and 10.1. On all the
devices, it doesn't crash but only on the devices with version 4.1.2.


On Wed, Jul 31, 2013 at 7:34 PM, Piren <[email protected]> wrote:

> Your images are not 2.3MB, their compressed data is... the images when
> loaded by Android are much more than that (their size according to android
> is basically their resolution times the bit depth per pixel you defined).
> The last image you loaded asked for 8.4MB alone...
>
> I assume that you don't actually need to load all those images at the same
> time since you dont have the screen space for that, so load them only when
> they are visible and free them as soon as they are not.
>
>
> On Wednesday, July 31, 2013 4:46:43 PM UTC+3, Matt wrote:
>>
>> Hi all,
>>
>> I am loading several images on Fragments. I have about 22 images of total
>> 2.3 MB. I am getting OutOfMemory error every time I test my app on devices
>> with Jelly Bean 4.1.2. The weird thing is, this happens only when I test it
>> on devices with Android version 4.1.2. It works fine on any other versions
>> on any devices. I am posting my error log here. Please let me know what
>> could be wrong:
>>
>> 07-31 14:08:48.688: D/dalvikvm(11970): GC_FOR_ALLOC freed 963K, 42% free
>> 24641K/41863K, paused 30ms, total 31ms
>> 07-31 14:08:48.688: I/dalvikvm-heap(11970): Grow heap (frag case) to
>> 29.015MB for 3932176-byte allocation
>> 07-31 14:08:48.748: D/dalvikvm(11970): GC_CONCURRENT freed 2170K, 38%
>> free 26311K/41863K, paused 14ms+5ms, total 60ms
>> 07-31 14:08:48.803: D/dalvikvm(11970): GC_FOR_ALLOC freed 0K, 38% free
>> 26311K/41863K, paused 17ms, total 17ms
>> 07-31 14:08:48.803: I/dalvikvm-heap(11970): Forcing collection of
>> SoftReferences for 8847376-byte allocation
>> 07-31 14:08:48.828: D/dalvikvm(11970): GC_BEFORE_OOM freed 0K, 38% free
>> 26311K/41863K, paused 25ms, total 25ms
>> 07-31 14:08:48.828: E/dalvikvm-heap(11970): Out of memory on a
>> 8847376-byte allocation.
>> 07-31 14:08:48.828: I/dalvikvm(11970): "main" prio=5 tid=1 RUNNABLE
>> 07-31 14:08:48.828: I/dalvikvm(11970):   | group="main" sCount=0
>> dsCount=0 obj=0x4119c508 self=0x40f509a0
>> 07-31 14:08:48.828: I/dalvikvm(11970):   | sysTid=11970 nice=0 sched=0/0
>> cgrp=apps handle=1074540336
>> 07-31 14:08:48.828: I/dalvikvm(11970):   | schedstat=( 14365434265
>> 4071559868 25502 ) utm=1314 stm=122 core=1
>> 07-31 14:08:48.828: I/dalvikvm(11970):   at android.graphics.**
>> BitmapFactory.**nativeDecodeAsset(Native Method)
>> 07-31 14:08:48.828: I/dalvikvm(11970):   at android.graphics.**
>> BitmapFactory.decodeStream(**BitmapFactory.java:625)
>> 07-31 14:08:48.828: I/dalvikvm(11970):   at android.graphics.**
>> BitmapFactory.**decodeResourceStream(**BitmapFactory.java:478)
>> 07-31 14:08:48.828: I/dalvikvm(11970):   at android.graphics.drawable.**
>> Drawable.**createFromResourceStream(**Drawable.java:781)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at android.content.res.Resources.
>> **loadDrawable(Resources.java:**1963)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at android.content.res.Resources.
>> **getDrawable(Resources.java:**672)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at android.view.View.**
>> setBackgroundResource(View.**java:14497)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at com.example.myexample.pages.*
>> *CoverPage.onActivityCreated(**CoverPage.java:46)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at android.support.v4.app.**
>> Fragment.**performActivityCreated(**Fragment.java:1468)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at android.support.v4.app.**
>> FragmentManagerImpl.**moveToState(FragmentManager.**java:931)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at android.support.v4.app.**
>> FragmentManagerImpl.**moveToState(FragmentManager.**java:1088)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at android.support.v4.app.**
>> BackStackRecord.run(**BackStackRecord.java:682)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at android.support.v4.app.**
>> FragmentManagerImpl.**execPendingActions(**FragmentManager.java:1444)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at android.support.v4.app.**
>> FragmentManagerImpl$1.run(**FragmentManager.java:429)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at android.os.Handler.**
>> handleCallback(Handler.java:**615)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at android.os.Handler.**
>> dispatchMessage(Handler.java:**92)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at android.os.Looper.loop(Looper.
>> **java:137)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at android.app.ActivityThread.**
>> main(ActivityThread.java:4921)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at 
>> java.lang.reflect.Method.**invokeNative(Native
>> Method)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at java.lang.reflect.Method.**
>> invoke(Method.java:511)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at com.android.internal.os.**
>> ZygoteInit$**MethodAndArgsCaller.run(**ZygoteInit.java:1027)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at com.android.internal.os.**
>> ZygoteInit.main(ZygoteInit.**java:794)
>> 07-31 14:08:48.833: I/dalvikvm(11970):   at 
>> dalvik.system.NativeStart.**main(Native
>> Method)
>> 07-31 14:08:48.833: A/libc(11970): Fatal signal 11 (SIGSEGV) at
>> 0x00000000 (code=1), thread 11970 (ple.storybookex)
>> 07-31 14:08:58.808: E/run(11970): run-runnable
>>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Android Developers" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/android-developers/4ziD1KLInco/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

*Thanks & Regards,**
*

*Maitrey Chhaya*

*Junior Software Engineer*

* *

*Rossitek Software Solutions*****

*#320/B, Sri Manjunatha Arcade,*

*1st phase, 2nd Stage 40 ft Road.*

*Manjunathnagar, Bangalore-560 010*

*Board Number       : ** +91 80 41440617*



www.rossitek.com <http://www.mavego.com/>****



*Offshore Mobile & Software Development House*

*IT Capital of India, Bangalore*

*Offshore Development Projects, Teams and Solutions*

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to