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

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


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

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

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

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

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

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


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