[android-developers] OutOFMemoryError (UNEXPECTED TOP-LEVEL ERROR [ GC overhead limit exceeded/java.lang.OutOfMemoryError: Java heap space])while running the dex command using ANT script

2017-08-26 Thread Haidar Ali
 

While running the below command to convert jar to dex or multidex, I am 
getting below error,


Command : dx.sh --dex --multi-dex --output=. Test.jar


UNEXPECTED TOP-LEVEL ERROR:

java.lang.OutOfMemoryError: Java heap space

2017-08-24, 13:48:21 ERROR 
[jobKey=emm_f61b1de6_b45e_4be6_aeb8_86e422937af5_WRAP_JOB_GROUP.WRAP_JOB_7764918539210721583,schema=emm_f61b1de6_b45e_4be6_aeb8_86e422937af5]
 
: com.kony.mam.wrap.AntLoggerListener - Result: 3

Or Sometimes,

UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: GC overhead limit exceeded
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

Above problem is getting resolved when changing the value of dx.sh from 
defaultMx from 1 GB to 2GB but some of the machine throwing as below error

Java HotSpot(TM) 64-Bit Server VM warning: INFO: 
os::commit_memory(0xcde8f000, 309305344, 0) failed; error='Cannot 
allocate memory' (errno=12)
2017-08-21, 12:24:49 ERROR 
jobKey=emm_00449007_c75d_4674_9152_3344bacc05dc_WRAP_JOB_GROUP.WRAP_JOB_7764371816673453494,schema=emm_00449007_c75d_4674_9152_3344bacc05dc
 

 
: com.kony.mam.wrap.AntLoggerListener - Result: 1
2017-08-21, 12:24:49 ERROR 
jobKey=emm_00449007_c75d_4674_9152_3344bacc05dc_WRAP_JOB_GROUP.WRAP_JOB_7764371816673453494,schema=emm_00449007_c75d_4674_9152_3344bacc05dc
 

 
: com.kony.mam.wrap.AntLoggerListener - Task "fail" finished with error.


Kindly help us to resolve this issue.



-- 
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 android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/63ef7758-fa7e-4886-ba43-d19444aece5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] OutOfMemoryError

2011-11-24 Thread bob
OutOfMemoryError

I'm getting this OutOfMemoryError:

11-24 00:38:10.925: ERROR/dalvikvm-heap(1782): 144-byte external
allocation too large for this process.
11-24 00:38:10.965: ERROR/GraphicsJNI(1782): VM won't let us allocate
144 bytes
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): FATAL EXCEPTION: main
11-24 00:38:11.205: ERROR/AndroidRuntime(1782):
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:447)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:520)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
com.youniversalideas.rockyartue.MyApp.getBitmap(MyApp.java:1047)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
com.youniversalideas.rockyartue.MyApp.loadImages(MyApp.java:1217)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
com.youniversalideas.rockyartue.Panel.onDraw(Panel.java:906)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.View.draw(View.java:6880)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.ViewGroup.drawChild(ViewGroup.java:1646)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.ViewGroup.drawChild(ViewGroup.java:1644)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.View.draw(View.java:6883)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.widget.FrameLayout.draw(FrameLayout.java:363)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.ViewGroup.drawChild(ViewGroup.java:1646)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.View.draw(View.java:6883)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.widget.FrameLayout.draw(FrameLayout.java:363)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
com.android.internal.policy.impl.PhoneWindow
$DecorView.draw(PhoneWindow.java:1862)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.ViewRoot.draw(ViewRoot.java:1522)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.ViewRoot.performTraversals(ViewRoot.java:1258)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.os.Handler.dispatchMessage(Handler.java:99)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.os.Looper.loop(Looper.java:123)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
android.app.ActivityThread.main(ActivityThread.java:3647)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
java.lang.reflect.Method.invokeNative(Native Method)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
java.lang.reflect.Method.invoke(Method.java:507)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
dalvik.system.NativeStart.main(Native Method)

Is there any easy way around this, or do I just have to use less
memory?  This game works fine on my phone, but strangely the error
shows up on my tablet.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] OutOfMemoryError

2011-11-24 Thread Johan Rydenstam
Are you using different resources for the tablet (like hdpi?).

I would check for memory leaks. There are tools you can use for this ( Eclipse 
memory analyzer)
 
On Nov 24, 2011, at 9:51 AM, bob wrote:

 OutOfMemoryError
 
 I'm getting this OutOfMemoryError:
 
 11-24 00:38:10.925: ERROR/dalvikvm-heap(1782): 144-byte external
 allocation too large for this process.
 11-24 00:38:10.965: ERROR/GraphicsJNI(1782): VM won't let us allocate
 144 bytes
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): FATAL EXCEPTION: main
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782):
 java.lang.OutOfMemoryError: bitmap size exceeds VM budget
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:447)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:520)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.youniversalideas.rockyartue.MyApp.getBitmap(MyApp.java:1047)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.youniversalideas.rockyartue.MyApp.loadImages(MyApp.java:1217)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.youniversalideas.rockyartue.Panel.onDraw(Panel.java:906)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.View.draw(View.java:6880)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.drawChild(ViewGroup.java:1646)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.drawChild(ViewGroup.java:1644)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.View.draw(View.java:6883)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.widget.FrameLayout.draw(FrameLayout.java:363)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.drawChild(ViewGroup.java:1646)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.View.draw(View.java:6883)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.widget.FrameLayout.draw(FrameLayout.java:363)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.android.internal.policy.impl.PhoneWindow
 $DecorView.draw(PhoneWindow.java:1862)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewRoot.draw(ViewRoot.java:1522)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewRoot.performTraversals(ViewRoot.java:1258)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.os.Handler.dispatchMessage(Handler.java:99)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.os.Looper.loop(Looper.java:123)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.app.ActivityThread.main(ActivityThread.java:3647)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 java.lang.reflect.Method.invokeNative(Native Method)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 java.lang.reflect.Method.invoke(Method.java:507)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:839)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 dalvik.system.NativeStart.main(Native Method)
 
 Is there any easy way around this, or do I just have to use less
 memory?  This game works fine on my phone, but strangely the error
 shows up on my tablet.
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] OutOfMemoryError

2011-11-24 Thread Francisco Dalla Rosa soares
I don't have the link right now but I read somewhere that if you want to
allocate more memory (especially for images) you can just allocate them as
opengl textures as those don't count as heap memory.

I'll try to find the link and get some more detailed info to you.

2011/11/24 Johan Rydenstam johanrydens...@googlemail.com

 Are you using different resources for the tablet (like hdpi?).

 I would check for memory leaks. There are tools you can use for this ( Eclipse
 memory analyzer)

 On Nov 24, 2011, at 9:51 AM, bob wrote:

 OutOfMemoryError

 I'm getting this OutOfMemoryError:

 11-24 00:38:10.925: ERROR/dalvikvm-heap(1782): 144-byte external
 allocation too large for this process.
 11-24 00:38:10.965: ERROR/GraphicsJNI(1782): VM won't let us allocate
 144 bytes
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): FATAL EXCEPTION: main
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782):
 java.lang.OutOfMemoryError: bitmap size exceeds VM budget
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:447)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:520)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.youniversalideas.rockyartue.MyApp.getBitmap(MyApp.java:1047)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.youniversalideas.rockyartue.MyApp.loadImages(MyApp.java:1217)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.youniversalideas.rockyartue.Panel.onDraw(Panel.java:906)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.View.draw(View.java:6880)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.drawChild(ViewGroup.java:1646)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.drawChild(ViewGroup.java:1644)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.View.draw(View.java:6883)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.widget.FrameLayout.draw(FrameLayout.java:363)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.drawChild(ViewGroup.java:1646)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.View.draw(View.java:6883)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.widget.FrameLayout.draw(FrameLayout.java:363)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.android.internal.policy.impl.PhoneWindow
 $DecorView.draw(PhoneWindow.java:1862)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewRoot.draw(ViewRoot.java:1522)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewRoot.performTraversals(ViewRoot.java:1258)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.os.Handler.dispatchMessage(Handler.java:99)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.os.Looper.loop(Looper.java:123)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 android.app.ActivityThread.main(ActivityThread.java:3647)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 java.lang.reflect.Method.invokeNative(Native Method)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 java.lang.reflect.Method.invoke(Method.java:507)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:839)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
 11-24 00:38:11.205: ERROR/AndroidRuntime(1782): at
 dalvik.system.NativeStart.main(Native Method)

 Is there any easy way around this, or do I just have to use less
 memory?  This game works fine on my phone, but strangely the error
 shows up on my tablet.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 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 post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this 

Re: [android-developers] OutOfMemoryError

2011-09-05 Thread NWD Sports
The AVD Manager correlates the amount of storage on the device to the amount of 
RAM.

From: TreKing 
Sent: Sunday, September 04, 2011 10:35 PM
To: android-developers@googlegroups.com 
Subject: Re: [android-developers] OutOfMemoryError

On Sun, Sep 4, 2011 at 9:18 PM, NWD Sports nwdspo...@hotmail.com wrote:

  If I read it correctly, than changing the size of the SD card would matter 
because that is the amount of space that the AVD manager allocates to the 
specific AVD for app implementation on an Android Virtual Device.

How would this give you more RAM to work with?

-
TreKing - Chicago transit tracking app for Android-powered devices


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] OutOfMemoryError

2011-09-05 Thread TreKing
On Mon, Sep 5, 2011 at 12:30 PM, NWD Sports nwdspo...@hotmail.com wrote:

 The AVD Manager correlates the amount of storage on the device to the
 amount of RAM.


It does? I see a section for SD Card size and a section for Hardware, one
of which is the device Ram size, and you set them both independently. I
don't see how these are in any way related. What am I missing?

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] OutOfMemoryError

2011-09-05 Thread NWD Sports
Yes on my version of the SDK manager for some reason increasing SD card size 
increases the RAM size as well. I don’t know why but that is what I assumed it 
did for everyone. Sorry for any confusion.

From: TreKing 
Sent: Monday, September 05, 2011 11:16 AM
To: android-developers@googlegroups.com 
Subject: Re: [android-developers] OutOfMemoryError

On Mon, Sep 5, 2011 at 12:30 PM, NWD Sports nwdspo...@hotmail.com wrote:

  The AVD Manager correlates the amount of storage on the device to the amount 
of RAM.

It does? I see a section for SD Card size and a section for Hardware, one of 
which is the device Ram size, and you set them both independently. I don't see 
how these are in any way related. What am I missing?

-
TreKing - Chicago transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] OutOfMemoryError

2011-09-05 Thread TreKing
On Mon, Sep 5, 2011 at 2:21 PM, NWD Sports nwdspo...@hotmail.com wrote:

 Yes on my version of the SDK manager for some reason increasing SD card
 size increases the RAM size as well. I don’t know why but that is what I
 assumed it did for everyone. Sorry for any confusion.


Interesting. Thanks for clarifying.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] OutOfMemoryError

2011-09-04 Thread NWD Sports
Yes. Go to the AVD manager and find the virtual device you use to debug on. 
Set the SD card size to a higher value. you shouldn't run into the problem 
again.




Nicholas L. - NWD Sports.com Co-Founder
-Original Message- 
From: bob

Sent: Friday, September 02, 2011 7:43 PM
To: Android Developers
Subject: [android-developers] OutOfMemoryError

I'm getting an OutOfMemoryError.  Is there any way to increase the
amount of memory my app can use?

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] OutOfMemoryError

2011-09-04 Thread TreKing
On Fri, Sep 2, 2011 at 6:55 PM, NWD Sports nwdspo...@hotmail.com wrote:

 Yes. Go to the AVD manager and find the virtual device you use to debug on.
 Set the SD card size to a higher value. you shouldn't run into the problem
 again.


I think you missed the OP's problem ... this has nothing to do with the size
of the SD card.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] OutOfMemoryError

2011-09-04 Thread NWD Sports
If the app is running out of memory than I can’t think of any other reason why 
it would be doing that. If I read it correctly, than changing the size of the 
SD card would matter because that is the amount of space that the AVD manager 
allocates to the specific AVD for app implementation on an Android Virtual 
Device.

From: TreKing 
Sent: Sunday, September 04, 2011 4:21 PM
To: android-developers@googlegroups.com 
Subject: Re: [android-developers] OutOfMemoryError

On Fri, Sep 2, 2011 at 6:55 PM, NWD Sports nwdspo...@hotmail.com wrote:

  Yes. Go to the AVD manager and find the virtual device you use to debug on. 
Set the SD card size to a higher value. you shouldn't run into the problem 
again.

I think you missed the OP's problem ... this has nothing to do with the size of 
the SD card.

-
TreKing - Chicago transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] OutOfMemoryError

2011-09-04 Thread TreKing
On Sun, Sep 4, 2011 at 9:18 PM, NWD Sports nwdspo...@hotmail.com wrote:

 If I read it correctly, than changing the size of the SD card would matter
 because that is the amount of space that the AVD manager allocates to the
 specific AVD for app implementation on an Android Virtual Device.


How would this give you more RAM to work with?

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] OutOfMemoryError

2011-09-02 Thread bob
I'm getting an OutOfMemoryError.  Is there any way to increase the
amount of memory my app can use?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] OutOfMemoryError

2011-09-02 Thread Mark Murphy
On Fri, Sep 2, 2011 at 7:43 PM, bob b...@coolgroups.com wrote:
 I'm getting an OutOfMemoryError.  Is there any way to increase the
 amount of memory my app can use?

Not for pre-Honeycomb, and even on Honeycomb it's not the sort of
thing you want to be doing, because it may irritate your users for you
to be kicking all their other apps out of RAM. You need to track down
your memory leak, perhaps using MAT:

http://www.youtube.com/watch?v=_CruQY55HOk

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android 3.1 Programming Books: http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] OutOfMemoryError in Google Maps' ZoomHelper.createSnapshot

2011-07-19 Thread navtej
I have an application that uses the Google Maps MapView component and
I've found that this crash is far and away the most common report in
my market publisher dashboard. I'm not sure what I can do about it
aside from reducing my own memory consumption. I know that will help
some, but it doesn't seem like it will fully solve this problem (since
sometimes the memory requests are the size of the entire heap). Are
there any known solutions to this?

Some of the stacktraces start with lines telling me how much was
requested:
java.lang.OutOfMemoryError: bitmap size exceeds VM budget(Heap
Size=16775KB, Allocated=11760KB, Bitmap Size=16055KB)
java.lang.OutOfMemoryError: bitmap size exceeds VM budget(Heap
Size=18311KB, Allocated=13082KB, Bitmap Size=14342KB)
java.lang.OutOfMemoryError: bitmap size exceeds VM budget(Heap
Size=18896KB, Allocated=14683KB, Bitmap Size=9620KB)
java.lang.OutOfMemoryError: bitmap size exceeds VM budget(Heap
Size=16519KB, Allocated=11198KB, Bitmap Size=16813KB)
java.lang.OutOfMemoryError: bitmap size exceeds VM budget(Heap
Size=11435KB, Allocated=9983KB, Bitmap Size=12261KB)
java.lang.OutOfMemoryError: bitmap size exceeds VM budget(Heap
Size=10487KB, Allocated=8670KB, Bitmap Size=13394KB)
etc.

These bitmap sizes just seem particularly huge and I don't know why
GMaps would be trying to allocate a single bitmap that size. Should I
really be expecting that much free space to be available in the native
bitmap heap? I do understand that some devices count the bitmap heap
against the VM heap and some devices don't.

I found this on stackoverflow with no real solution:
http://stackoverflow.com/questions/5066102/google-api-mapview-outofmemoryerror-problems

full stacktrace:

java.lang.OutOfMemoryError: bitmap size exceeds VM budget
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:677)
at com.google.android.maps.ZoomHelper.createSnapshot(ZoomHelper.java:
444)
at com.google.android.maps.ZoomHelper.beginZoom(ZoomHelper.java:194)
at com.google.android.maps.MapView$2.onScaleBegin(MapView.java:371)
at
android.view.ScaleGestureDetector.onTouchEvent(ScaleGestureDetector.java:
216)
at com.google.android.maps.MapView.onTouchEvent(MapView.java:646)
at
com.redfin.android.view.GesturedMapView.onTouchEvent(GesturedMapView.java:
183)
at android.view.View.dispatchTouchEvent(View.java:3778)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:920)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:959)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:959)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:959)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:959)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:959)
at com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchTouchEvent(PhoneWindow.java:1716)
at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:
1124)
at android.app.Activity.dispatchTouchEvent(Activity.java:2125)
at com.android.internal.policy.impl.PhoneWindow
$DecorView.dispatchTouchEvent(PhoneWindow.java:1700)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1822)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:5068)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] OutofmemoryError

2011-04-26 Thread subhashini alaguchokku
Hi!

Im got BitmapSize exceeds VM budget outof memory error. any one have idea?
how to clear the memory.here i loaded the too many gallery image.


Thanks and Regards,
Suba.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] OutofmemoryError

2011-04-26 Thread Kapil Lokhande
Hi  suba,

I think you have to compress images and make them small size images. This
error is only comes on some of the android devices.

--
Thanks  Regards,
Kapil Lokhande | Dexter Advisory Pvt. Ltd. http://dexterltd.com/ | Android
Developer
[image: dexterlogo.jpg]


On Wed, Apr 27, 2011 at 10:13 AM, subhashini alaguchokku 
subhashini.andr...@gmail.com wrote:

 Hi!

 Im got BitmapSize exceeds VM budget outof memory error. any one have
 idea? how to clear the memory.here i loaded the too many gallery image.


 Thanks and Regards,
 Suba.

  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=endexterlogo.jpg

[android-developers] OutOfMemoryError- while to download big data and storing in db4o

2011-04-13 Thread imran ali
Hi all,

in my application i have to download big data approx 20MB text and
after parsing i have to save in db4o for that i have been making lots
of object of classes,
i am doing all thing in separate thread and after use of object
immediately i am giving null vales to all objects.
still after approx 8MB it has been giving error
java.lang.OutOfMemoryError.

can any one tell me what I have to do to fix it?

Thanks
Imran ali

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] outOfMemoryError

2011-03-29 Thread vani reddy
I am getting the outOfMemoryError,bitmap size exceeds the virtual machine
budget

i am doing the below


public void getBitmap1(String str)
{
 InputStream is =null;
try {
 URL myFileUrl =new URL(str);
HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection();
conn.setDoInput(true);
conn.connect();
 is = conn.getInputStream();
Bitmap orgImg = BitmapFactory.decodeStream(is);//this  line it is throwing
exception
barcode_bitmap.add(orgImg);//   barcode_bitmap is an arraylist of bitmap.
 } catch (IOException e) {
e.printStackTrace();
 }
 finally{
if(is!=null)
{
try {
is.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
 }

How to resolve this, it comes once in a while.
Please help,Thanks in advance:-)

-- 
 Regards,
Vani Reddy

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] outOfMemoryError

2011-03-29 Thread sukumar bhashyam
Try recycling the unused bitmap. Not sure why do you need to store the all
bitmaps in ArrayList.

There could be a memory leak. Analyse the memory usage of your application.
Check here for more info (
http://android-developers.blogspot.com/2011/03/memory-analysis-for-android.html)
.



On Tue, Mar 29, 2011 at 6:07 PM, vani reddy vani.redd...@gmail.com wrote:

 I am getting the outOfMemoryError,bitmap size exceeds the virtual machine
 budget

 i am doing the below


 public void getBitmap1(String str)
  {
  InputStream is =null;
  try {
  URL myFileUrl =new URL(str);
  HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection();
 conn.setDoInput(true);
  conn.connect();
  is = conn.getInputStream();
 Bitmap orgImg = BitmapFactory.decodeStream(is);//this  line it is throwing
 exception
  barcode_bitmap.add(orgImg);//   barcode_bitmap is an arraylist of bitmap.
   } catch (IOException e) {
 e.printStackTrace();
  }
  finally{
 if(is!=null)
 {
  try {
 is.close();
 } catch (IOException e) {
  // TODO Auto-generated catch block
 e.printStackTrace();
 }
  }
 }
  }

 How to resolve this, it comes once in a while.
 Please help,Thanks in advance:-)

 --
  Regards,
 Vani Reddy

  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] OutofMemoryError on Thunderbolt: HttpClient.execute

2011-03-29 Thread Nathan
I am getting reports of an OutofMemoryError in
AbstractSessionInputBuffer using HttpClient.execute.

Coincidentally, all those who have personally emailed me have the HTC
Thunderbolt.

I've run allocationtracker and stuff, but it has been of limited use
when I can't reproduce the problem.

Yes, I know that a place where you get the OutofMemory isn't
necessarily the cause of the problem. I am looking at everything,
including bitmap allocations. But customer feedback suggests that this
might happen before those other allocations happen, meaning there
could be memory lost in some of these http retrievals.

Here's something I can't explain. I've added a catch(OutOfMemoryError
err) around this spot in my latest version. How am I still getting
errors with the same stack trace? I would think it would start failing
somewhere else.

And has anyone seen anything weird with the HTC Thunderbolt?

Nathan




java.lang.OutOfMemoryError: (Heap Size=16327KB, Allocated=14167KB,
Bitmap Size=7690KB)
at org.apache.http.util.ByteArrayBuffer.init(ByteArrayBuffer.java:
53)
at
org.apache.http.impl.io.AbstractSessionInputBuffer.init(AbstractSessionInputBuffer.java:
82)
at
org.apache.http.impl.io.SocketInputBuffer.init(SocketInputBuffer.java:
93)
at
org.apache.http.impl.SocketHttpClientConnection.createSessionInputBuffer(SocketHttpClientConnection.java:
83)
at
org.apache.http.impl.conn.DefaultClientConnection.createSessionInputBuffer(DefaultClientConnection.java:
170)
at
org.apache.http.impl.SocketHttpClientConnection.bind(SocketHttpClientConnection.java:
106)
at
org.apache.http.impl.conn.DefaultClientConnection.openCompleted(DefaultClientConnection.java:
129)
at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:
173)
at
org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:
164)
at
org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:
119)
at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:
348)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
555)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
487)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
465)

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] OutofMemoryError on Thunderbolt: HttpClient.execute

2011-03-29 Thread Mark Murphy
http://stackoverflow.com/questions/5358014/android-httpclient-oom-on-4g-lte-htc-thunderbolt

HTC, for unknown reasons, messed up the buffer size. If you set it
yourself, the problem goes away.

On Tue, Mar 29, 2011 at 4:16 PM, Nathan critter...@crittermap.com wrote:
 I am getting reports of an OutofMemoryError in
 AbstractSessionInputBuffer using HttpClient.execute.

 Coincidentally, all those who have personally emailed me have the HTC
 Thunderbolt.

 I've run allocationtracker and stuff, but it has been of limited use
 when I can't reproduce the problem.

 Yes, I know that a place where you get the OutofMemory isn't
 necessarily the cause of the problem. I am looking at everything,
 including bitmap allocations. But customer feedback suggests that this
 might happen before those other allocations happen, meaning there
 could be memory lost in some of these http retrievals.

 Here's something I can't explain. I've added a catch(OutOfMemoryError
 err) around this spot in my latest version. How am I still getting
 errors with the same stack trace? I would think it would start failing
 somewhere else.

 And has anyone seen anything weird with the HTC Thunderbolt?

 Nathan




 java.lang.OutOfMemoryError: (Heap Size=16327KB, Allocated=14167KB,
 Bitmap Size=7690KB)
 at org.apache.http.util.ByteArrayBuffer.init(ByteArrayBuffer.java:
 53)
 at
 org.apache.http.impl.io.AbstractSessionInputBuffer.init(AbstractSessionInputBuffer.java:
 82)
 at
 org.apache.http.impl.io.SocketInputBuffer.init(SocketInputBuffer.java:
 93)
 at
 org.apache.http.impl.SocketHttpClientConnection.createSessionInputBuffer(SocketHttpClientConnection.java:
 83)
 at
 org.apache.http.impl.conn.DefaultClientConnection.createSessionInputBuffer(DefaultClientConnection.java:
 170)
 at
 org.apache.http.impl.SocketHttpClientConnection.bind(SocketHttpClientConnection.java:
 106)
 at
 org.apache.http.impl.conn.DefaultClientConnection.openCompleted(DefaultClientConnection.java:
 129)
 at
 org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:
 173)
 at
 org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:
 164)
 at
 org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:
 119)
 at
 org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:
 348)
 at
 org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
 555)
 at
 org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
 487)
 at
 org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
 465)

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in London: http://bit.ly/smand1, http://bit.ly/smand2

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] OutOfMemoryError

2010-10-18 Thread Julie Andrews
Which is the longest word in English?
Smiles – Because a ‘mile’ exists between the two S’s. While that is a good
answer to the riddle, the actual longest English word is
‘floccinaucinihilipilification’- which means’to describe something as
worthless, or turning something into being worthless by deprecating it.’

On Tue, Oct 12, 2010 at 5:07 PM, Lisa lpk...@gmail.com wrote:

 Hi, My name is Lisa .
 I am studying Android development.

 So I have a problem

 It immediately has trouble with memory.
 In the LogCat this error is displayed,

  java.lang.OutOfMemoryError: bitmap size exceeds VM budget

 I'm using recycle () and System.gc ()  but I get the same error.
 My application, is pressing a button switches to the next image and
 the images are 854x480
 Loading images from the SD Card.
 show the images as follows

 Bitmap imageB;
 ImageView imgV;

 imageB = BitmapFactory.decodeFile (sdcard / img.png);
 imgV.setImageBitmap (imageB);

 Release is as follow.

 @ Override
 protected void onDestroy () {
super.onPause ();
imageBG = null;
System.gc ();

 }

 please help me out to solve the issu.
 sorry for my bad English

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Julie
http://tradinglogically.blogspot.com http://tradinglogically.blogspot.com
http://vikitionary.blogspot.com
http://gandhi-the-man-of-millenium.blogspot.com/

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] OutOfMemoryError

2010-10-14 Thread Lisa
please help me. 。゜゜(´□`。)°゜。

I am using android 1.6.

my code to release a bitmap looks like this:

if (imageBG != null) {
  imageBG.recycle();
imageBG = null;

}

but when I do get to the following error: (u_u,)

10-14 11:36:52.069: ERROR/AndroidRuntime(618): Uncaught handler:
thread main exiting due to uncaught exception
10-14 11:36:52.089: ERROR/AndroidRuntime(618):
java.lang.RuntimeException: Canvas: trying to use a recycled bitmap
android.graphics.bit...@437d8e60
10-14 11:36:52.089: ERROR/AndroidRuntime(618): at
android.graphics.Canvas.throwIfRecycled(Canvas.java:955)
10-14 11:36:52.089: ERROR/AndroidRuntime(618): at
android.graphics.Canvas.drawBitmap(Canvas.java:1044)
10-14 11:36:52.089: ERROR/AndroidRuntime(618): at
android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:291)
...

What should I do? ~(・・?)
I do not know how to release memory. 。゜゜(´□`。)°゜。

please, help me.┌(_ _)┐

Thanks a lot for all your replies. m(_ _)m

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] OutOfMemoryError

2010-10-14 Thread Kumar Bibek
You might need to scale the Bitmap so that it doesn't use of a lot of
memory.

Follow this link, you might get an idea here.
http://stackoverflow.com/questions/3331527/android-resize-a-large-bitmap-file-to-scaled-output-file

On Thu, Oct 14, 2010 at 5:42 PM, Lisa lpk...@gmail.com wrote:

 please help me. 。゜゜(´□`。)°゜。

 I am using android 1.6.

 my code to release a bitmap looks like this:

 if (imageBG != null) {
 imageBG.recycle();
imageBG = null;

 }

 but when I do get to the following error: (u_u,)

 10-14 11:36:52.069: ERROR/AndroidRuntime(618): Uncaught handler:
 thread main exiting due to uncaught exception
 10-14 11:36:52.089: ERROR/AndroidRuntime(618):
 java.lang.RuntimeException: Canvas: trying to use a recycled bitmap
 android.graphics.bit...@437d8e60
 10-14 11:36:52.089: ERROR/AndroidRuntime(618): at
 android.graphics.Canvas.throwIfRecycled(Canvas.java:955)
 10-14 11:36:52.089: ERROR/AndroidRuntime(618): at
 android.graphics.Canvas.drawBitmap(Canvas.java:1044)
 10-14 11:36:52.089: ERROR/AndroidRuntime(618): at
 android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:291)
 ...

 What should I do? ~(・・?)
 I do not know how to release memory. 。゜゜(´□`。)°゜。

 please, help me.┌(_ _)┐

 Thanks a lot for all your replies. m(_ _)m

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] OutOfMemoryError

2010-10-13 Thread Lisa
Hi, My name is Lisa .
I am studying Android development.

So I have a problem

It immediately has trouble with memory.
In the LogCat this error is displayed,

 java.lang.OutOfMemoryError: bitmap size exceeds VM budget

I'm using recycle () and System.gc ()  but I get the same error.
My application, is pressing a button switches to the next image and
the images are 854x480
Loading images from the SD Card.
show the images as follows

Bitmap imageB;
ImageView imgV;

imageB = BitmapFactory.decodeFile (sdcard / img.png);
imgV.setImageBitmap (imageB);

Release is as follow.

@ Override
protected void onDestroy () {
super.onPause ();
imageBG = null;
System.gc ();

}

please help me out to solve the issu.
sorry for my bad English

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] OutOfMemoryError with Bitmap

2010-07-22 Thread ReyLith
Hi,

I'm developing an image editor for Android. When I do some operations
with small pictures (600x600 - 1024x768), the program work well. But
when I do some opeations with big pictures, I always obtain an
OutOfMemory Error. I read read many post trying to have the image in
memory. Also I looked at the Android's Gallery, trying to simulate the
effect of loading the image with lower quality and get the complete
quality after a while. But I doesn't get to work with large images.

I thought of using the parameter inSampleSize but I raised the problem
of having to perform operations on the image and save it with the
original size, so it no longer serves me. The only thing I've done is
use the parameter inJustDecodeBounds and display an error to the user
if the image exceeds the available memory.

Is there any possibility of working with large images with no memory
problems?

I need urgent help. Thank you very much in advance. Thanks,

JESÚS

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] OutOfMemoryError

2010-06-10 Thread svebee
hello, as I'm beginner in Android I have problem with memory - after
only 2-3 minutes I get Force Close and outOfMemory Error.

I have only onCreate (I know, stupid, but I didn't knew for anything
else as I started only few weeks ago) and inside I have...

@Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);

  many lines of code...manipulating with SQLite databases...

}

inside main XML layout I have many images, small, big (background) and
so on...How can I on every onCreate delete all content from memory
that was before in it - so when I open activity again, it deletes all
images and everything out and insert the new (old) one inside.
Little awkward but that's only thing I have on mind.

Also, inside many lines of code I don't declare any images!

Or simply, how can I bypass outOfMemoryError? Do I have to do
something like this?

 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

BitmapFactory.Options options=new BitmapFactory.Options();
options.inSampleSize = 8;
Bitmap buildingBitmap =
BitmapFactory.decodeResource(null,R.drawable.background,options);

if (buildingBitmap != null)
{
buildingBitmap.recycle();
System.gc();
buildingBitmap = null;
}

  setContentView(R.layout.main);

  many lines of code...manipulating with SQLite databases...

}

or...? Also on other activity is everything the same except I have
multiple overlays, how can I erase (recycle) them also? Thank you
for any help.

*currently, I'm not searching for fastest, most correct or better
solution, I just want something that it's not crashing all the time

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] OutOfMemoryError

2010-06-10 Thread Adrian Vintu
What does logcat say?

see
http://developer.android.com/intl/de/guide/developing/tools/adb.html
and
http://www.adrianvintu.com/blogengine/post/Colored-Logcat-Script-for-Windows.aspx
if you don't know what logcat is.

BR,
Adrian Vintu
http://www.adrianvintu.com


On Thu, Jun 10, 2010 at 4:28 PM, svebee sven.kapud...@gmail.com wrote:

 hello, as I'm beginner in Android I have problem with memory - after
 only 2-3 minutes I get Force Close and outOfMemory Error.

 I have only onCreate (I know, stupid, but I didn't knew for anything
 else as I started only few weeks ago) and inside I have...

 @Override
  public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);

  many lines of code...manipulating with SQLite databases...

 }

 inside main XML layout I have many images, small, big (background) and
 so on...How can I on every onCreate delete all content from memory
 that was before in it - so when I open activity again, it deletes all
 images and everything out and insert the new (old) one inside.
 Little awkward but that's only thing I have on mind.

 Also, inside many lines of code I don't declare any images!

 Or simply, how can I bypass outOfMemoryError? Do I have to do
 something like this?

  @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

BitmapFactory.Options options=new BitmapFactory.Options();
options.inSampleSize = 8;
Bitmap buildingBitmap =
 BitmapFactory.decodeResource(null,R.drawable.background,options);

 if (buildingBitmap != null)
{
buildingBitmap.recycle();
System.gc();
buildingBitmap = null;
}

  setContentView(R.layout.main);

  many lines of code...manipulating with SQLite databases...

}

 or...? Also on other activity is everything the same except I have
 multiple overlays, how can I erase (recycle) them also? Thank you
 for any help.

 *currently, I'm not searching for fastest, most correct or better
 solution, I just want something that it's not crashing all the time

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] OutOfMemoryError: how best to transfer large video files into a byte array?

2010-04-08 Thread Anna PS
Apologies for cross-posting with StackOverflow, but I'm getting a bit
desperate. I'll cross-post any final answer too.

Please could anyone suggest an approach for transferring a 2MB video
from a ContentResolver into a Bytestream, without running out of
memory?

See question: 
http://stackoverflow.com/questions/2599305/android-outofmemoryerror-while-uploading-video-how-best-to-chunk

Here's the current code, which throws an OutOfMemoryError on the
byteBuffer.write(buffer, 0, len) line when transferring large videos:

// get bytestream to upload
videoByteArray = getBytesFromFile(cR, fileUriString);

public static byte[] getBytesFromFile(ContentResolver cR, String
fileUriString) throws IOException {
Uri tempuri = Uri.parse(fileUriString);
InputStream is = cR.openInputStream(tempuri);
byte[] b3 = readBytes(is);
is.close();
return b3;
}
public static byte[] readBytes(InputStream inputStream) throws
IOException {
ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream();
// this is storage overwritten on each iteration with bytes
int bufferSize = 1024;
byte[] buffer = new byte[bufferSize];
int len = 0;
while ((len = inputStream.read(buffer)) != -1) {
byteBuffer.write(buffer, 0, len);
}
return byteBuffer.toByteArray();
}

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] OutOfMemoryError: how best to transfer large video files into a byte array?

2010-04-08 Thread Abdul Mateen
It tried very much on this, but I had to gave up, it seems not possible as
far as I think, lets get the experts reply.



On Fri, Apr 9, 2010 at 1:58 AM, Anna PS annapowellsm...@googlemail.comwrote:

 Apologies for cross-posting with StackOverflow, but I'm getting a bit
 desperate. I'll cross-post any final answer too.

 Please could anyone suggest an approach for transferring a 2MB video
 from a ContentResolver into a Bytestream, without running out of
 memory?

 See question:
 http://stackoverflow.com/questions/2599305/android-outofmemoryerror-while-uploading-video-how-best-to-chunk

 Here's the current code, which throws an OutOfMemoryError on the
 byteBuffer.write(buffer, 0, len) line when transferring large videos:

 // get bytestream to upload
 videoByteArray = getBytesFromFile(cR, fileUriString);

 public static byte[] getBytesFromFile(ContentResolver cR, String
 fileUriString) throws IOException {
Uri tempuri = Uri.parse(fileUriString);
InputStream is = cR.openInputStream(tempuri);
byte[] b3 = readBytes(is);
is.close();
return b3;
 }
 public static byte[] readBytes(InputStream inputStream) throws
 IOException {
ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream();
// this is storage overwritten on each iteration with bytes
int bufferSize = 1024;
byte[] buffer = new byte[bufferSize];
int len = 0;
while ((len = inputStream.read(buffer)) != -1) {
byteBuffer.write(buffer, 0, len);
}
return byteBuffer.toByteArray();
 }

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] OutOfMemoryError: how best to transfer large video files into a byte array?

2010-04-08 Thread Mark Murphy
Anna PS wrote:
 Apologies for cross-posting with StackOverflow, but I'm getting a bit
 desperate. I'll cross-post any final answer too.
 
 Please could anyone suggest an approach for transferring a 2MB video
 from a ContentResolver into a Bytestream, without running out of
 memory?

1. Why are you using a ContentProvider?

2. What are you doing with the 2MB byte array when you get it on the
ContentResolver side?

My hope is that there's a way to avoid the problem altogether.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] OutofMemoryError: bitmap size exceeds VM budget.....

2009-12-17 Thread Abhi
Hi,

I am doing the following in my app, which at times results in the
above error.

Action 1: Button on Main activity calls all pictures using ACTION_PICK
(results in a thumbnail view of all pictures on my phone). User picked
image (URI) is then passed over to next activity where the image is
displayed (ImageView) full screen. When I hit back, I go back to the
main activity. If I try to open all pictures and pick a picture again,
I get a FORCE CLOSE and the logCat data says OutofMemoryError: bitmap
size exceeds VM budget.

Action 2: I get the same error and FORCE CLOSE when I try to rotate
the full-sized picture by changing phone orientation back and forth.

What am I supposed to do to save memory? I can't change the use case
of my app... the user has to follow the above steps. How can I free up
memory without having to change anything in my app.

Thanks,

Abhi

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] [OutOfMemoryError] How to release Drawable object from memory ?

2009-11-28 Thread nada fatma
The Light Of Truth







[align=left]What is life? Man's existence in this world and the creation of
this entire universe are not mere accidents or products of a fortuitous
nature. This universe, every single atom of it, manifests and leads us to
the realization of a Loving, Merciful and All-powerful Creator. Without a
Creator, nothing can exist. Every single soul knows that he is existing and
that his existence is dependent upon a Creator he knows for sure that he
cannot create himself. Therefore it is his duty to know his master, the
Creator.

Mankind: Man is a unique creature. God gave man the ability to govern over
all other creatures in this world. He is endowed with the faculty of reason
which sets him apart from all other animals. Together with this faculty to
discriminate and discern, man is given the freedom (free-will) to choose for
himself a way of life worthy of his position or to fall lower than the
lowest of all animals or creations. Man is born pure and sinless and is
given the choice to do righteous deeds or indulge in sins.

Divine Guidance: The Creator, out of His abundant Love and Mercy for mankind
has not left us in darkness to discover the right path by trial and error
alone. Coupled with our intellectual capability to reason, our Creator
bestowed upon us Divine Guidance that outlines the criterion for truth,
knowledge, as well as the reality of our existence in this world and the
Hereafter.

Revelations: From the beginning of mankind, our Creator sent Prophets to
convey His revelation and to invite human beings to the path of true peace
and obedience to the One True God. This is Islam. This message is conveyed
towards successive generations of man through the different prophets, all
inviting mankind to the same path. However all the earlier messages or
revelations from God were distorted by people of later generations.

As a result of this distortion, pure Revelation from our Creator was
adulterated and polluted with myths, superstitions, idol worship and
irrational philosophical ideologies. The religion of God in a sense was lost
in a plethora of religions. Human history is a testament of man's drift
between light and darkness, but God out of His abundant love for mankind has
not forsaken us.

Final Revelation: When mankind was in the depths of the Dark Ages, our
Creator sent His final Messenger, Prophet Muhammad (sallallahu ‘alaihi wa
sallam) to redeem humanity with the final revelation which represents the
ultimate and permanent source of guidance for the whole world.

Criteria For Truth: The following criteria can best serve as a gauge to find
out the authenticity of the last revelation (the Qur'aan) as the Word of
God:

Rational Teachings:
Since our Creator bestowed reason and intellect upon us, it is our duty to
use it to distinguish the truth from falsehood. True, undistorted revelation
from God must be rational and can be reasoned out by all unbiased minds.

Perfection:
Since our Creator is all perfect, His revelation must be perfect and
accurate, free from mistakes, omissions, interpolations and multiplicity of
versions. It should be free from contradictions in its narration.

No Myths or Superstitions:
True revelation is free from myths or superstitions that degrade the dignity
of our Creator or man himself.

Scientific:
Since our Creator is the Creator of all knowledge, true revelation is
scientific and can withstand the challenge of science at all times.

Factual Prophecy:
Our Creator is the Knower of the past, present and future. Thus His
prophecies in His revelation will be fulfilled as prophesied.

Inimitable By Man:
True revelation is infallible and cannot be imitated by man. God's true
revelation is a Living miracle, an open book challenging all mankind to see
and prove for themselves its authenticity or veracity[/align]





Hi my name is Nada


THERE IS NO GOD BUT ONE


you don't know about ISLAM
if you want to know mail me on
nada-fa...@maktoob.com

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] [OutOfMemoryError] How to release Drawable object from memory ?

2009-11-26 Thread Syl
In my application, user can click on a button and then he can select a
picture from his gallery.
This image is then displayed.

However, when the user performs 3 or 4 times this operation, the
following exception is thrown, due to memory allocation problem :


11-26 18:31:34.119: ERROR/dalvikvm-heap(707): 6291456-byte external
allocation too large for this process.
11-26 18:31:34.119: ERROR/(707): VM won't let us allocate 6291456
bytes
11-26 18:31:34.119: DEBUG/skia(707): 
allocPixelRef failed
11-26 18:31:36.005: DEBUG/AndroidRuntime(707): Shutting down VM
11-26 18:31:36.005: WARN/dalvikvm(707): threadid=3: thread exiting
with uncaught exception (group=0x40013e28)
11-26 18:31:36.005: ERROR/AndroidRuntime(707): Uncaught handler:
thread main exiting due to uncaught exception
11-26 18:31:36.099: ERROR/AndroidRuntime(707):
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:304)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.graphics.drawable.Drawable.createFromStream(Drawable.java:635)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
com.altran.test.selectpicture.MainActivity.onActivityResult
(MainActivity.java:74)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.app.Activity.dispatchActivityResult(Activity.java:3415)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.app.ActivityThread.deliverResults(ActivityThread.java:2835)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.app.ActivityThread.handleSendResult(ActivityThread.java:2881)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.app.ActivityThread.access$2300(ActivityThread.java:112)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1608)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.os.Handler.dispatchMessage(Handler.java:88)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.os.Looper.loop(Looper.java:123)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
android.app.ActivityThread.main(ActivityThread.java:3742)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
java.lang.reflect.Method.invokeNative(Native Method)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
java.lang.reflect.Method.invoke(Method.java:515)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:739)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
11-26 18:31:36.099: ERROR/AndroidRuntime(707): at
dalvik.system.NativeStart.main(Native Method)



Here a sample of my code where problem is focused :

InputStream is = getContentResolver().openInputStream( currImageURI );
Drawable drawable = Drawable.createFromStream( is, src );
is.close();
m_imageView.setBackgroundDrawable( drawable );



Is it possible to force object (here the Drawable object) to be
released from memory ?

Thanks.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] OutOfMemoryError

2009-06-19 Thread Francois

Hello all,

For my project (quite a big project), an Android application create, I
need to compile the sources from a command line. So I have followed
the explanations found in the dev guide.
I have set JAVA_HOME to a short directory name, and created the
project with the Android command.

When I compile the project, with ant debug as stated in the doc, it
works fine until it reaches the dex creator.

[echo] Convertine compiled files and external libraries into bin/
classes.dex

It seems to work for like 10 seconds, then it stops with this error:

UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: Java heap space

OK, after searching on the internet, I have tried to set the heap of
my Java VM, by changing the ANT_OPTS environement variable to:
set ANT_OPTS=-Xms512m -Xmx1024m (I have tried different values).

I still get the same error.

Is it a known bug? Is there something I can to do avoid it?

Thanks in advance for you advices.

Francois

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] OutOfMemoryError at BitmapFactory.decodeByteArray

2009-06-08 Thread loril...@gmail.com

I get a OutOfMemoryError at BitmapFactory.decodeByteArray when bitmap
size is large; Following is the code snippet:

BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 8;
Bitmap bitmap = null;
bitmap = BitmapFactory.decodeByteArray(data, 0, data.length,
options);

where data is a byte array of length 407287

I  tried using bitmap.recycle, setting the bitmap to null and setting
BitmapFactory options SampleSize but still I get the following error:


ERROR/AndroidRuntime(5399):java.lang.OutOfMemoryError: bitmap size
exceeds VM budget
ERROR/AndroidRuntime(5399):at
android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)
ERROR/AndroidRuntime(5399):at
android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:308)

I have seen a few posts related to this issue but could not find a
solution. Could anyone please let me know how to fix this issue?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] OutOfMemoryError, but there's lots of memory?!

2009-06-06 Thread Keith Wiley

My app is building a relatively large structure (large being a term
that is meaningless without context), and I am getting an
OutOfMemoryError.  Problem is, I'm watching the memory using every
metric I can think of, and I don't see how the error was triggered.
It's obviously trying to allocate a 65kB HashSet in a rehash
operation:

06-06 17:59:11.234: ERROR/dalvikvm-heap(1884): Out of memory on a
65552-byte allocation.

Which makes sense; I traced it to the HashSet operation it is
performing.  But this is what the memory looks at:

ActivityManager.Memory Info: availMem: 26300416B, 26300KB, 26MB
ActivityManager.Memory Info: threshold/lowMemory: 16777216  false
Runtime.freeMemory: 1828856B, 1829KB, 2MB
Runtime.totalMemory: 15605728B, 15606KB, 16MB
Debug memory allocated/native/default: 4452208  1032336  5484544

I don't get it.  Why won't it make a measly 65kB heap?  How can I
detect memory problems given these utilities if they always return
extremely large values right before and after an OutOfMemoryError?
Are there yet additional memory utilities I should be using?

Thank you for any help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] OutOfMemoryError when changing screen orientation

2009-05-08 Thread geopicmob...@googlemail.com

Hi,

I get an OutOfMemoryError every time i change the screen orientation
and I am having a hard time finding the mistake...

The Activitie's view consists of an ImageView, two Buttons and a
Spinner. I don't have static variables and can't imagine where i could
leak a context.

Most of the times, the exception is thrown at setContentView
(R.layout.upload);
sometimes it goes fine until imgUpload.setImageURI(imageURI);

The images i am displaying are form the G1's camera, so about 500kb
and 2048x1536pixels

Here is some code:
-
private ImageView imgUpload;
private Spinner spnCollections;
private Button btnEditMetadata;
private Button btnUpload;
private Uri imageURI;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.upload);

// Get View References
imgUpload = (ImageView) findViewById(R.id.imgUpload);
spnCollections = (Spinner)findViewById(R.id.spnCollections);
btnEditMetadata = (Button) findViewById(R.id.btnEditMetadata);
btnUpload = (Button)findViewById(R.id.btnUpload);

// Get Image from ACTION_SEND Intent
Intent intent = getIntent();
if (intent.getAction() != null  intent.getAction().equals
(Intent.ACTION_SEND)) {
Bundle extras = intent.getExtras();
imageURI = 
(Uri)extras.getParcelable(Intent.EXTRA_STREAM);
imgUpload.setImageURI(imageURI);
}
...
-

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] OutOfMemoryError from BitmapFactory

2009-05-01 Thread Ward Willats

At 2:35 PM -0700 4/30/09, fadden wrote:
The hprof dump can help with that.  I added a quick writeup:

http://android.git.kernel.org/?p=platform/dalvik.git;a=blob_plain;f=docs/heap-profiling.html;hb=HEAD

Thanks -- I used hprof with a previous layout leakage problem, and I 
think it is a huge turd on toast -- at least the default HTML output 
anyway. Lot's of noise and very little insight. Maybe there are 
better viewers for that data.

In fact, that experience tells me that leaking view trees makes a 
noticeable dent in the regular object heap that is easily seen in 
ddms. Since this problem is causing none of that, it has to be 
something else. Hopefully I'll get to run some more experiments today.

-- Ward

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] OutOfMemoryError from BitmapFactory

2009-04-30 Thread Ward Willats

At 11:23 AM -0700 4/30/09, fadden wrote:
It's possible that it didn't actually jump back down.  The event log
shows results from all running processes, not just your app, so you
may be seeing output from other things mixed in.

Ah, OK. Now I see a steady increase in my limit and allocs from 1.1 
up to about 10 MB when it crashes, and I've got another 3.5 in my 
regular heap -- still less than 16, but ok, -- so this makes sense, 
and I hope this thread is useful to others -- you can leak and 
look fine in ddms!

But this means that the bitmaps for my startup animations, say, are 
never getting freed, as are the contents of previous screens. Now, 
none of this stuff is kept in static variables or anything (he said, 
though you can be sure he is going to check this yet again!)

Is there a way to really really make these things get tossed? There 
ain't no recycle() on drawable (or animation I think)just 
bitmaps

(This is why the python script I posted yesterday shows the pid and 5-
char app id on each line.)

I seem to have completely missed this post...

Thanks

-- Ward

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] OutOfMemoryError from BitmapFactory

2009-04-30 Thread Ward Willats

Thanks for these tips.

At 1:14 PM -0700 4/30/09, Streets Of Boston wrote:
In my app, i've been dillegently 'unloading' bitmaps when i need
memory.
- clear any bitmap cache

I assume you mean any of my own bitmap caches...

So far, this scheme has served me well. Before i got a lot of OOM-
errors. Now i get a lot less. And, if i still get one, i try to
handle it gracefully.

It still seems like Voodo to me. If I have to manually call 
setImageBitmap(null) it implies (to me) that the image view is not 
being released in the first place, which means the view hierarchy is 
not being released, even though I have called finish(). At the moment 
I am looking for static variables and leaked contexts

-- Ward

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] OutOfMemoryError from BitmapFactory

2009-04-29 Thread Ward Willats

I'm going to try to throw something together in python or C that does
the number-crunching on the log.

Well, I'm as old as Mark Murphy for cris'sake, so I like to use AWK 
for things like this, which seemed a good idea until I remembered it 
doesn't support infix bitwise operators. Doh! Guess I'll have to 
learn something new sometime...

Oh well, I switched to gawk and did this aeheap.awk (android external heap):

BEGIN { FS=,; }

/I\/dvm_gc_info/ {
 print $0;
 print $4;
 innum = substr($4,1,length($4)-2);  # strip ] off end
 print innum;
 inlo = and( innum, 0xFFF );
 inhi = and( rshift(innum,12),0xFFF);
 print inlo, inhi;
 print Alloc:, lshift( and(inlo,0x1ff),(rshift(inlo,9) * 4));
 print Limit:, lshift( and(inhi,0x1ff),(rshift(inhi,9) * 4));
}
Used thusly:

adb logcat -b events -d | /opt/local/bin/gawk -f aeheap.awk -

I get output that agrees with your example at the end of

http://groups.google.com/group/android-developers/browse_thread/thread/6c90a2c70f3593f1/7974ba6fe0361e91?q=fadden+event+log#7974ba6fe0361e91

if I force the 0x783 value in.

A sample:

I/dvm_gc_info( 1868): 
[8320808730293606135,-8914445585825568708,-4006653253327009911,7862064]
7862064]
7862064
1840 1919
Alloc: 1245184
Limit: 1568768

If this seems rational, I will now take out the extra print 
statements and run this baby next time my app crashes with OOM.

Thanks

-- Ward

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] OutOfMemoryError from BitmapFactory

2009-04-29 Thread Ward Willats

At 10:26 PM -0700 4/28/09, fadden wrote:
Well, that's the interesting question: how much memory are you
*actually* spending on bitmaps?

While I wait for a crash I can measure, my colleague here points out 
we use a lot of 9 patches as backgrounds for various fields on our 
screens. If they go into bitmap storage, and aren't regularly 
compacted as we move from screen to screen, well, that could suck 
down a lot of the external heap (and fragment it to boot). Perhaps 
single large bitmaps we could preload would be better.

Is that a nutty hypothesis?

-- Ward

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] OutOfMemoryError from BitmapFactory

2009-04-28 Thread Ward Willats

At 12:05 PM -0700 4/28/09, Jon Webb wrote:
I have a clue -- the OutOfMemoryError went away when I set debuggable
to false. Does that help?

No joy here, I'm afraid. I really hoped this would be it. (Debuggable 
changing garbage collection behavior or something...)

I just happened to have a section of code that blows up reliably 
after a opening and then closing the G1 screen. Setting 
debuggable=false had no effect.

Going into set content view I garbage collect and then I have 972K on 
a 3.2 MB heap:

   04-28 13:00:14.375 setContentView(v)  b4 memory: T:3284960 - F:971728 (bytes)

But during inflation, ~540ms later:

04-28 13:00:14.915 E/dalvikvm-heap(  677): 62500-byte external 
allocation too large for this process.
04-28 13:00:14.915 E/(  677): VM won't let us allocate 62500 bytes
04-28 13:00:14.915 D/AndroidRuntime(  677): Shutting down VM

04-28 13:00:14.955 E/AndroidRuntime(  677): Caused by: 
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
04-28 13:00:14.955 E/AndroidRuntime(  677): at 
android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
04-28 13:00:14.955 E/AndroidRuntime(  677): at 
android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:290)
04-28 13:00:14.955 E/AndroidRuntime(  677): at 
android.graphics.drawable.Drawable.createFromStream(Drawable.java:635)
04-28 13:00:14.955 E/AndroidRuntime(  677): at 
android.content.res.Resources.loadDrawable(Resources.java:1454)
04-28 13:00:14.955 E/AndroidRuntime(  677): at 
android.content.res.Resources.getDrawable(Resources.java:498)
04-28 13:00:14.955 E/AndroidRuntime(  677): at 
android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:143)
04-28 13:00:14.955 E/AndroidRuntime(  677): at 
android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:716)
04-28 13:00:14.955 E/AndroidRuntime(  677): at 
android.graphics.drawable.Drawable.createFromXml(Drawable.java:667)
04-28 13:00:14.955 E/AndroidRuntime(  677): at 
android.content.res.Resources.loadDrawable(Resources.java:1439)
04-28 13:00:14.955 E/AndroidRuntime(  677): at 
android.content.res.TypedArray.getDrawable(TypedArray.java:520)
04-28 13:00:14.955 E/AndroidRuntime(  677): at 
android.view.View.init(View.java:1674)
04-28 13:00:14.955 E/AndroidRuntime(  677): at 
android.view.View.init(View.java:1622)
04-28 13:00:14.955 E/AndroidRuntime(  677): ... 31 more


I don't see the system (1.1) garbage collecting or trying to grow the 
heap though when it gets into this kind of trouble...

A full release build (with logging off and debuggable off and javac 
debug off) also blows up in the same way.

So am I really out of memory or just chasing my tail?

This is a big screen, for sure. But then, the system loaded it once, 
then again in landscape -- then blew up the third time going back to 
portrait. I am forcing a garbage collect each onResume(), ddms shows 
the heap steady-states through all this -- no obvious leakage.

-- Ward

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] OutOfMemoryError from BitmapFactory

2009-04-28 Thread Ward Willats

Thanks for this excellent explanation.

Weird parallel universe indeed! So, right in the onCreate() of my 
application object, I went and allocated an 8MB array of bytes, 
causing the heap to grow to 10MB. I then null the array ref and call 
gc(), which freed up the allocation but left the heap at 10MB. I 
thought I was moving the soft limit up.

My init code runs and starts loading bitmaps left and right for the 
UI and now it craps out real early, every time. Yipes! I've made 
things much worse!

04-28 18:01:54.675 D/AppStart  ( 1443): memory: T:10756064 - F:8716000 (bytes)
04-28 18:01:54.875 D/dalvikvm( 1443): GC freed 349 objects / 24792 
bytes in 108ms
04-28 18:01:55.385 D/dalvikvm( 1443): GC freed 192 objects / 7800 bytes in 92ms
04-28 18:01:55.425 E/dalvikvm-heap( 1443): 115600-byte external 
allocation too large for this process.

So this separate pile for bitmaps doesn't grow with the VM heap -- 
in fact, growing the VM heap made it smaller (I think) because, as 
you say, that space came out of total 16 MB allocation (?)

So what is a good strategy to grab more of my allocation for bitmaps? 
Preload every single bitmap at startup and keep them around? or? Any 
insights into how this separate bitmap store behaves 
(growing/shrinking) is of great interest!

I mean, I could always use LESS memory, but dang...it seems like 
since I am well under-budget 16MB wise, there should be some way to 
make this work...

Thanks

-- Ward






At 5:05 PM -0700 4/28/09, fadden wrote:
On Apr 28, 1:33 pm, Ward Willats goo...@wardco.com wrote:
  So am I really out of memory or just chasing my tail?

You're really out of memory.

Bitmap storage exists in a weird parallel universe.  The memory isn't
allocated in the virtual heap, but we act like it is when it comes to
deciding if you're out of memory.  The per-VM cap is 16MB.

(Aside: suppose you have 2MB of stuff, and the soft limit is 3MB.
You allocate a bunch of objects until you hit the 3MB mark, then a GC
happens.  If you free enough, the soft limit stays where it is.  If
you don't free enough, the soft limit is advanced.  This way we're
not allocating physical memory pages that we don't need, but neither
are we GCing constantly.  Choosing the right value for enough is
something of an art.)

If you have, say, 4MB of bitmaps, and you start allocating lots of
objects, you will OOM when you hit 12MB of objects.

Where things get a little quirky is that the opposite isn't true: if
you run out of memory while allocating a bitmap, we don't GC.  Freeing
objects won't help unless the soft limit moves.  (I think we can
shrink it now, but I suspect we can only do that if there are no
objects sitting out at the end -- remember, the Dalvik GC doesn't do
compaction at this time, which is the main reason why we have this
somewhat bizarre tiered system.)

If the bitmaps were proper objects on the virtual heap, this would be
less weird, but there's a fair chance you'd still be running out of
memory at this point.



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] OutOfMemoryError (external allocation too large for this process)

2009-04-02 Thread zeeshan

Hi Experts,

I am beating my head against a wall since 3 days trying to resolve out
of memory exception but still no success.
here is the line giving me this error


 image_view.setImageURI(image_uri);

everytime when i change the orientation or start this activity again,
it gives me out of memory exception

VM won't let us allocate 6291456 bytes.

it seems i am not leting GC to release my memory.
any solution would be appreciated
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] OutOfMemoryError when scrolling ListView

2009-01-29 Thread muckwarrior

I'm having problems with ListViews in my application. I thought
everything was fine until I noticed that if I scrolled up and down
through the list quickly a number of times, sooner or later the app
would crash with an OutOfMemoryError.

When I searched for the error I noticed a number of posts related to
loading images. As my list items included a small arrow png, I assumed
the problem lay here. However even after removing this and all other
drawables I had (gradient background and list separator) the problem
still remains.

Here's the stack trace

ERROR/dalvikvm-heap(2362): 66560-byte external allocation too large
for this process.
ERROR/(2362): VM won't let us allocate 66560 bytes
DEBUG/AndroidRuntime(2362): Shutting down VM
WARN/dalvikvm(2362): threadid=3: thread exiting with uncaught
exception (group=0x40013e28)
ERROR/AndroidRuntime(2362): Uncaught handler: thread main exiting due
to uncaught exception
ERROR/AndroidRuntime(2362): java.lang.OutOfMemoryError: bitmap size
exceeds VM budget
ERROR/AndroidRuntime(2362): at android.graphics.Bitmap.nativeCreate
(Native Method)
ERROR/AndroidRuntime(2362): at android.graphics.Bitmap.createBitmap
(Bitmap.java:343)
ERROR/AndroidRuntime(2362): at android.view.View.buildDrawingCache
(View.java:5219)
ERROR/AndroidRuntime(2362): at android.view.View.getDrawingCache
(View.java:5112)
ERROR/AndroidRuntime(2362): at android.view.ViewGroup.drawChild
(ViewGroup.java:1355)
ERROR/AndroidRuntime(2362): at android.view.ViewGroup.dispatchDraw
(ViewGroup.java:1192)
ERROR/AndroidRuntime(2362): at
android.widget.AbsListView.dispatchDraw(AbsListView.java:1125)
ERROR/AndroidRuntime(2362): at android.widget.ListView.dispatchDraw
(ListView.java:2778)
ERROR/AndroidRuntime(2362): at android.view.View.draw(View.java:
5422)
ERROR/AndroidRuntime(2362): at android.view.ViewGroup.drawChild
(ViewGroup.java:1420)
ERROR/AndroidRuntime(2362): at android.view.ViewGroup.dispatchDraw
(ViewGroup.java:1192)
ERROR/AndroidRuntime(2362): at android.view.ViewGroup.drawChild
(ViewGroup.java:1418)
ERROR/AndroidRuntime(2362): at android.view.ViewGroup.dispatchDraw
(ViewGroup.java:1192)
ERROR/AndroidRuntime(2362): at android.view.View.draw(View.java:
5329)
ERROR/AndroidRuntime(2362): at android.widget.FrameLayout.draw
(FrameLayout.java:324)
ERROR/AndroidRuntime(2362): at android.view.ViewGroup.drawChild
(ViewGroup.java:1420)
ERROR/AndroidRuntime(2362): at android.view.ViewGroup.dispatchDraw
(ViewGroup.java:1192)
ERROR/AndroidRuntime(2362): at android.view.ViewGroup.drawChild
(ViewGroup.java:1418)
ERROR/AndroidRuntime(2362): at android.view.ViewGroup.dispatchDraw
(ViewGroup.java:1192)
ERROR/AndroidRuntime(2362): at android.view.View.draw(View.java:
5329)
ERROR/AndroidRuntime(2362): at android.widget.FrameLayout.draw
(FrameLayout.java:324)
ERROR/AndroidRuntime(2362): at
com.android.internal.policy.impl.PhoneWindow$DecorView.draw
(PhoneWindow.java:1701)
ERROR/AndroidRuntime(2362): at android.view.ViewRoot.draw
(ViewRoot.java:980)
ERROR/AndroidRuntime(2362): at
android.view.ViewRoot.performTraversals(ViewRoot.java:829)
ERROR/AndroidRuntime(2362): at android.view.ViewRoot.handleMessage
(ViewRoot.java:1103)
ERROR/AndroidRuntime(2362): at android.os.Handler.dispatchMessage
(Handler.java:88)
ERROR/AndroidRuntime(2362): at android.os.Looper.loop(Looper.java:
123)
ERROR/AndroidRuntime(2362): at android.app.ActivityThread.main
(ActivityThread.java:3742)
ERROR/AndroidRuntime(2362): at
java.lang.reflect.Method.invokeNative(Native Method)
ERROR/AndroidRuntime(2362): at java.lang.reflect.Method.invoke
(Method.java:515)
ERROR/AndroidRuntime(2362): at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:739)
ERROR/AndroidRuntime(2362): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
ERROR/AndroidRuntime(2362): at dalvik.system.NativeStart.main
(Native Method)

I've had a look in DDMS and noticed that the percentage memory used in
the heap doesn't go above 70%. Also, doesn't the reported 66K seem
like a very small amount to be causing a crash?

Any help appreciated!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] OutOfMemoryError BitmapFactory.nativeDecodeByteArray inside Threads

2008-12-14 Thread plusminus

The following situation happens only in a few cases, but it does more
than once.
-

I'm receiving several OutOfMemoryError in
BitmapFactory.nativeDecodeByteArray.

DDMS-Heap-View never broke the 16MB barrier. I can't even get it above
6MB, while going wild and smashing keys like a monkey:
---
1   5,820 MB2,751 MB3,069 MB47,26%  54.433
---


The situation is that I have a ThreadPoolExector:
---
protected ExecutorService mThreadPool = Executors.newCachedThreadPool
();
---
... ,which load several 256x256 pngs to the RAM. (Average png-size: 
20kb)


StackTrace-Desciption:
That OutOfMemoryError happens several times in the Threads, until the
VM decides its enough and stops the whole process.

StackTrace:
#
W/AudioFlinger(   24): write blocked for 49 msecs
W/AudioFlinger(   24): write blocked for 48 msecs
W/AudioFlinger(   24): write blocked for 49 msecs
D/dalvikvm(  410): GC freed 31478 objects / 1613104 bytes in 196ms
D/dalvikvm(  410): GC freed 6404 objects / 991024 bytes in 151ms
D/dalvikvm(  410): GC freed 5224 objects / 1229888 bytes in 137ms
E/SOCKETLOG(  410): add_recv_stats recv 0
E/SOCKETLOG(  410): add_recv_stats recv 0
E/SOCKETLOG(  410): add_recv_stats recv 0
E/SOCKETLOG(  410): add_recv_stats recv 0
E/dalvikvm-heap(  410): 65536-byte external allocation too large for
this process.
E/dalvikvm-heap(  410): 65536-byte external allocation too large for
this process.
E/(  410): VM won't let us allocate 65536 bytes
W/dalvikvm(  410): threadid=59: thread exiting with uncaught exception
(group=0x40010e28)
E/AndroidRuntime(  410): Uncaught handler: thread pool-8-thread-6
exiting due to uncaught exception
E/(  410): VM won't let us allocate 65536 bytes
E/dalvikvm-heap(  410): 65536-byte external allocation too large for
this process.
W/dalvikvm(  410): threadid=65: thread exiting with uncaught exception
(group=0x40010e28)
E/dalvikvm-heap(  410): 65536-byte external allocation too large for
this process.
E/(  410): VM won't let us allocate 65536 bytes
W/dalvikvm(  410): threadid=43: thread exiting with uncaught exception
(group=0x40010e28)
E/AndroidRuntime(  410): Uncaught handler: thread pool-8-thread-3
exiting due to uncaught exception
E/AndroidRuntime(  410): java.lang.OutOfMemoryError: bitmap size
exceeds VM budget
E/AndroidRuntime(  410):at
android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)
E/AndroidRuntime(  410):at
android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:234)
E/AndroidRuntime(  410):at
android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:247)
E/AndroidRuntime(  410):at
org.andnav2.osm.views.tiles.OSMMapTileFilesystemCache$1.run
(OSMMapTileFilesystemCache.java:234)
E/AndroidRuntime(  410):at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:648)
E/AndroidRuntime(  410):at
java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:673)
E/AndroidRuntime(  410):at java.lang.Thread.run(Thread.java:
935)
E/(  410): VM won't let us allocate 65536 bytes
E/AndroidRuntime(  410): Uncaught handler: thread pool-8-thread-9
exiting due to uncaught exception
E/dalvikvm-heap(  410): 65536-byte external allocation too large for
this process.
E/(  410): VM won't let us allocate 65536 bytes
W/dalvikvm(  410): threadid=61: thread exiting with uncaught exception
(group=0x40010e28)
E/AndroidRuntime(  410): java.lang.OutOfMemoryError: bitmap size
exceeds VM budget
E/AndroidRuntime(  410):at
android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)
E/AndroidRuntime(  410):at
android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:234)
E/AndroidRuntime(  410):at
android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:247)
E/AndroidRuntime(  410):at
org.andnav2.osm.views.tiles.OSMMapTileFilesystemCache$1.run
(OSMMapTileFilesystemCache.java:234)
E/AndroidRuntime(  410):at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:648)
E/AndroidRuntime(  410):at
java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:673)
E/AndroidRuntime(  410):at java.lang.Thread.run(Thread.java:
935)
E/dalvikvm-heap(  410): 65536-byte external allocation too large for
this process.
E/AndroidRuntime(  410): java.lang.OutOfMemoryError: bitmap size
exceeds VM budget
E/AndroidRuntime(  410):at
android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)
E/AndroidRuntime(  410):at
android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:234)
E/AndroidRuntime(  410):at
android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:247)
E/AndroidRuntime(  410):at