[android-developers] Re: java.lang.OutOfMemoryError: GC overhead limit exceeded while building app

2016-08-12 Thread Nagendra Srivastava
I am also facing the same issue , I was working pretty well but some how it stopped working and I am stuck please help On Friday, 12 August 2016 12:41:45 UTC+5:30, Michael Moritz wrote: > > I am using Jack to be able to compile an app using java 8. After 8 mins of > compiling i get the followin

[android-developers] Re: java.lang.OutOfMemoryError on 4.0.3 APV and phone not in 2.1 2.3

2012-05-20 Thread jitendra patidar
Hi , i am using following attached three class to download images in my list view but when i display some of images on screen after that i got out of memory error and hang the application.in my app i am download thousands of images on a single screen. is it possible or not??. Thanks On Thur

[android-developers] Re: java.lang.OutOfMemoryError on 4.0.3 APV and phone not in 2.1 2.3

2012-05-18 Thread Solution 9420
? NewsGroup OK. I'm guessing here from my 2-day observation on this case. [First of All, this is the good reading. May not relate to this case] http://developer.android.com/resources/articles/avoiding-memory-leaks.html [What I did] - In my case is about those global bitmap. (I cache my own (i

[android-developers] Re: java.lang.OutOfMemoryError on 4.0.3 APV and phone not in 2.1 2.3

2012-05-17 Thread huberte
I dont understand what you mean, could you be more specific or post a code example ? thks Le jeudi 17 mai 2012 04:06:36 UTC-4, Solution 9420 a écrit : > > hi, > Just want to share with U that I also experienced the same scenario when I > did the compatibility test of my app (9420 Tablet Keyboa

Re: [android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2010-06-25 Thread Kevin Gaudin
That's right but there is some limitation though. I can't find a way to zoom on a detail of an hires JPEG, for example. Kevin On Fri, Jun 25, 2010 at 8:41 AM, Sebastian Roth wrote: > Hi Kevin: > > I think the memory for high megapixel images is not so important because u > usally will stream th

Re: [android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2010-06-24 Thread Sebastian Roth
Hi Kevin: I think the memory for high megapixel images is not so important because u usally will stream the image through a InputStream onto disk. You can then read the image via BitmapFactory and set a inSampleSize to retrieve it. BR, Seb, starting up a WIKI for android memory issues.. On Fri,

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2010-06-24 Thread Kevin Gaudin
Hi Romain, Is there a list somewhere of devices with 24Mb per process ? Is there a way to adjust this in the emulator ? Is there an API method allowing to know the total memory available for the process ? I'm writing a pictures manipulating app, and handling hires pics is hard with only 16Mb. New

Re: [android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2010-06-24 Thread Sebastian Roth
None of the tools I know work well with images and I'm not sure how to improve that. One way might be to use adb shell tools like dumpsys and compare the numbers over time, I heard. Not very convenient. I'm checking the difference between PNG8 and PNG24 now. From my understanding this could save s

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2010-06-17 Thread Nathan
Are any of those tools helpful with bitmaps? I've analyzed an HPRof where all the bitmaps are taking up32 bytes. that would be nice if it were true. I know that bitmaps are not on the regular heap, so the tools don't seem to find them. Since the bitmaps are marked as purgeable, they could be taki

Re: [android-developers] Re: java.lang.OutOfMemoryError

2010-06-10 Thread Stephen Eilert
On Thu, Jun 10, 2010 at 8:18 AM, Bob Kerns wrote: > What I was trying to get at is that if you're relying on System.gc(), > you're skating on the edge, memory-wise, tweaking the exact behavior > of the GC. > > I didn't mean to suggest it's not helpful; I've followed with interest > your reports of

[android-developers] Re: java.lang.OutOfMemoryError

2010-06-10 Thread Bob Kerns
What I was trying to get at is that if you're relying on System.gc(), you're skating on the edge, memory-wise, tweaking the exact behavior of the GC. I didn't mean to suggest it's not helpful; I've followed with interest your reports of your experience. But I'd characterize calling System.gc() as

[android-developers] Re: java.lang.OutOfMemoryError

2010-06-09 Thread Streets Of Boston
For Bitmaps, calling System.gc() can help quite a bit. The DalvikVM does not 'see' the raw binary data held by a Bitmap. The process may be getting close to out-of-memory while the DalvikVM thinks there is plenty the DalvikVM does not call a garbage collection when needed. When an allocation h

Re: [android-developers] Re: java.lang.OutOfMemoryError

2010-06-09 Thread Greg Donald
On Wed, Jun 9, 2010 at 9:35 PM, Bob Kerns wrote: > Carefully study the exception type hierarchy. Error and Exception are > distinct (and deliberately so). You are not catching OutOfMemoryError. That's what Stephen said, but thanks all the same. -- Greg Donald destiney.com | gregdonald.com --

[android-developers] Re: java.lang.OutOfMemoryError

2010-06-09 Thread Bob Kerns
Carefully study the exception type hierarchy. Error and Exception are distinct (and deliberately so). You are not catching OutOfMemoryError. But catching an OutOfMemoryError and retrying is unlikely to succeed. The VM does GC before throwing the error. It's not entirely pointless, however -- occas

[android-developers] Re: java.lang.OutOfMemoryError

2010-06-08 Thread Streets Of Boston
The code above does not make sure your bitmap will load. If there is just no memory available, then the second loading of the bitmap will fail as well and you'll still get the OOM exception. Your code makes a best effort to load a bitmap. This is because the raw binary data does count to the max l

[android-developers] Re: java.lang.OutOfMemoryError

2010-06-08 Thread Kumar Bibek
Well, each process is assigned a max heap size which varies from device to device. And since it is an error, your catch blocks would not be able to catch this. And also, calling gc might be able to help you if the bitmap size exceed the allocated heap size anyway. One workaround would be to scale

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-11 Thread Matt Kanninen
You catch out of memory? I wasn't willing to do that yet, but it would solve all my problems... On Dec 11, 7:09 am, Streets Of Boston wrote: > >>If you're nulling your static bitmap in onPause why is it static to begin > >>with?<< > > E.g. to have access to bitmaps outside of my activity, in cl

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-11 Thread Streets Of Boston
>>If you're nulling your static bitmap in onPause why is it static to begin >>with?<< E.g. to have access to bitmaps outside of my activity, in classes that don't have reference to my activities. Or, in case there can be multiple instance of an activity, these instances can share 'expensive' dat

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-11 Thread Ecthelion
Hi Matt, you could try explicitly freeing the resources your bitmaps use by invoking Bitmap.recycle(). The description of this method reads "Free up the memory associated with this bitmap's pixels, and mark the bitmap as "dead", meaning it will throw an exception if getPixels() or setPixels() is

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-10 Thread Matt Kanninen
I don't get it. If you're nulling your static bitmap in onPause why is it static to begin with? Also what you want to do is probably very different for a game that is basically all taking place in one activity and trying to avoid garbage collecting at all, compared to your standard Android app wi

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-10 Thread Streets Of Boston
Statically held (caches of) bitmaps may come in very very handy. However, as soon as you do hold static references to 'expensive' resources, be sure to have a proper clean-up strategy. E.g. make sure the capacity of your cache of bitmaps is limited. Be sure to set the static reference to null when

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-10 Thread Matt Kanninen
I recommend the only things you make static be strings, and that for everything else you are considering making static, instead write it to file and use static methods, that expect to be passed a context, to access the data. I think my problems might be camera related, so my plan is to stop using

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-10 Thread fadden
On Dec 8, 12:28 pm, skominac wrote: > So not only is memory of static members not deallocated (which is > actually not surprising), but the static references are still alive, > pointing to the memory, and can be used to invoke the members back. > This last part was surprising to me. > > This is ac

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-10 Thread skominac
It appears that static members of activity remain allocated and referenced between consecutive runs of Activity. I can actually draw the bitmap from the previous launch -- in a new launch (between finish () calls). It's still there. So not only is memory of static members not deallocated (which is

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-07 Thread skominac
On Dec 6, 10:23 pm, Romain Guy wrote: > How come you still have a reference to your bitmap when a new Activity > is created? That confuses me, too, actually. I really want to find out how I made this happen. > If you have this bitmap somewhere else than within the > Activity, then it's perfect

Re: [android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-06 Thread Romain Guy
How come you still have a reference to your bitmap when a new Activity is created? If you have this bitmap somewhere else than within the Activity, then it's perfectly normal that it's not de-allocated when the Activity disappears. In addition, if your Activity is not garbage collected, you probabl

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-06 Thread skominac
I had a similar issue. Calling "finish()" on Activity does not in itself deallocate memory allocated in Activity. The reason we notice this problem with bitmaps is because they are often so large. Recycling bitmaps did not work for me either. So, instead, when my Activity starts, and before I cre

Re: [android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-03 Thread SoftwareForMe.com SoftwareForMe.com
Hi Matt, I'm not aware of any other source. This we learned on our own on Friday, November 6th (Droid release day :-) To put it simply, say I have a 64x64 .png resource and use: Bitmap b = BitmapFactory.decodeResource(...) I will get a 64x64, 32-bit in-memory bitmap. If I use the exact same co

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-03 Thread Matt Kanninen
"My" app involves taking a picture with the camera, or recording voice using the microphone, and sending the results to the server. It's a search tool. The UI isn't very complicated, as much as possible it is done in XML. For the droid we added some layouts in res/long that differ only in layou

Re: [android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-02 Thread SoftwareForMe.com SoftwareForMe.com
The bitmap issue on the Droid is really about whether you want to show more graphics at smaller size, or the same graphics at larger size. I don't know what you app does, but imagine that it's a 2d game, where the graphics are re-used a lot (land tiles, character icons, etc.). If you let the high

Re: [android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-02 Thread Jason Proctor
IMHO, if the device offers 50% more memory per application, but the bitmaps take up more than 50% more memory, then the net effect is a stricter limitation. i'm seeing some occasional OOMs only on Droid, and so i'm being extra careful about recycling bitmaps and all that. At 5:40 PM -0800 12/

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-02 Thread Matt Kanninen
The same code works great on the G1 and the MyTouch. We've done some testing on the Hero, and the Moment, but only on the Droid is the issue significant. I've told my boss that I am spending time porting to the Droid. You have explained that "bitmaps are scaled and require more memory". This cre

Re: [android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-02 Thread Romain Guy
The new device does not have stricter limitations since it gives apps more RAM (24 MB instead of 16 MB.) On Wed, Dec 2, 2009 at 5:29 PM, Matt Kanninen wrote: > What did I do wrong?  I worked within the defined limitations, then a > new handset came out with stricter limitations. > > I'm kind of c

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-02 Thread Matt Kanninen
What did I do wrong? I worked within the defined limitations, then a new handset came out with stricter limitations. I'm kind of confused how you can blame me! On Dec 2, 5:19 pm, Romain Guy wrote: > The Droid has more pixels and a high display density, therefore > bitmaps are scaled and require

Re: [android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-02 Thread Romain Guy
The Droid has more pixels and a high display density, therefore bitmaps are scaled and require more memory. If your app is running out of memory, do not blame it on the framework and "poorer performance," blame it on your app for doing the wrong thing and abusing the Java heap. > The app worked gr

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-02 Thread Matt Kanninen
The app worked great on the G1. I've clearly hit a case where the framework made some decisions that result in poorer performance on the Droid. The bitmap out of memory errors can still occur on any setLayout(res/ xml/id), after running the app for 5-30 mins. But I did fix the bitmap out of memo

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-11-25 Thread Matt Kanninen
Thank you, this is exactly the sort of workaround I was looking for. I just filed the Media Recorder release bug, since the first bug got closed so fast. http://code.google.com/p/android/issues/detail?id=5047 On Nov 25, 11:43 am, Matt Hall wrote: > Yeah, we've had a similar issue before. One th

Re: [android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-11-25 Thread Matt Hall
Yeah, we've had a similar issue before. One thing you can try is to call recycle() on the last frame of your animation before you replace it. This is normally called by the garbage collector and works fine when you're not close to the memory limit, but it sounds like there might be cases where you

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-11-25 Thread Matt Kanninen
Matt, So in this case I definitely am frequently loading and unloading small images. Those 10 id's all point at different states in our animation. I can reduce the quality of our animation by reducing the views, and decrease how often I stumble down this cow path: but I only posted this stack t

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-11-25 Thread Matt Kanninen
Great guesses! This happens randomly through my application, every half hour on a G1, every 5 mins on the droid. The error happens randomly, usually in setContentView, per another post of mine. On Nov 25, 11:11 am, Streets Of Boston wrote: > As in the comment in your bug-report by Romain, you'r

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-11-25 Thread Streets Of Boston
As in the comment in your bug-report by Romain, you're using too much memory. Note that you only have 16MByte total available RAM for your process, including your bitmaps. - Only load the bitmaps that are absolutely necessary (especially when they become quite large). - Load the bitmaps scaled to

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-11-25 Thread Matt Hall
How big (dimensions) are the graphics Matt? If they're not very big then I'm guessing you have bitmap memory used elsewhere in the app that's putting you close to the max. Bitmap memory is different than your heap memory, so it's management is hidden from you a little more but basically this error

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-11-25 Thread Matt Kanninen
http://code.google.com/p/android/issues/detail?id=5045";>Issue 5045 http://code.google.com/p/android/issues/detail?id=5045 On Nov 25, 9:37 am, Matt Kanninen wrote: > This: >         private static final int[] glowDrawableIds={ >                 R.drawable.graphic_microphoneglow_01, >          

[android-developers] Re: java.lang.OutOfMemoryError after orientation changed

2009-11-03 Thread Mihai Fonoage
When an orientation occurs, your activity is being destroyed, and a new instance is created. The problem is that some references are still kept in memory. Some useful resources to read: "Avoiding memory leaks" (http://android- developers.blogspot.com/2009/01/avoiding-memory-leaks.html) and "Faster

[android-developers] Re: java.lang.OutOfMemoryError after orientation changed

2009-11-03 Thread fadden
On Oct 30, 12:23 pm, Sekar wrote: > 10-30 14:59:50.841: INFO/dalvikvm-heap(23490): Forcing collection of > SoftReferences for 134217760-byte allocation Curiously, 134217760 is 0x0820. Something went wrong in here. The original poster's allocation was 0x0A24, also suspiciously round. Is

[android-developers] Re: java.lang.OutOfMemoryError after orientation changed

2009-11-02 Thread Sekar
I have a MapView App that I wrote a while back in 1.1. It worked after I migrated it to 1.5. It is throwing the same exception you are seeing in 1.6. The App stopped working after the 1.6 system update. I got a chance today to upgrade my eclipse plugin to 0.9.5 and get the 1.6 sdk and deploy the Ap

[android-developers] Re: java.lang.OutOfMemoryError after orientation changed

2009-10-01 Thread Stefan
hi, i have test it without the mapView and my app work fine after i rotate the emulator. so the problem is the mapView. Can the display size a problem?? Because the button, which is over the MapView (if it will be activated), is positionated at the button of the display. But than i think, the Map

[android-developers] Re: java.lang.OutOfMemoryError after orientation changed

2009-10-01 Thread Beowolve
Actually I thought you set the size by your self, didn't notice that you posted the xml file. So you could have wrote the size to logcat with Log. So in this I don't know whats causing the view to consume memory that way it does. On 1 Okt., 17:25, Stefan wrote: > Hi > > On Oct 1, 5:09 pm, Beowol

[android-developers] Re: java.lang.OutOfMemoryError after orientation changed

2009-10-01 Thread Stefan
Hi On Oct 1, 5:09 pm, Beowolve wrote: > From the stack trace it looks like the memory allocation is done > inside the "Map.resize" function. > So you most likely set a enormous size after the orientation change to > your mapview. hmmm, i never set any size in my source code. > Adding some Log.

[android-developers] Re: java.lang.OutOfMemoryError after orientation changed

2009-10-01 Thread Beowolve
>From the stack trace it looks like the memory allocation is done inside the "Map.resize" function. So you most likely set a enormous size after the orientation change to your mapview. Adding some Log.i functions might narrow it down to the source of the problem. On 1 Okt., 16:18, Stefan wrote:

[android-developers] Re: java.lang.OutOfMemoryError after orientation changed

2009-10-01 Thread Stefan
Hi, On Oct 1, 4:07 pm, Mika wrote: > From the stack trace it seems that your trying to allocate 160 MB of > memory. And for one app the max heap size in Android is 16 Mb (if i > remember correctly). That's why the outofmemoryerror. Don't know why > are you allocating that much memory though?? i

[android-developers] Re: java.lang.OutOfMemoryError after orientation changed

2009-10-01 Thread Mika
>From the stack trace it seems that your trying to allocate 160 MB of memory. And for one app the max heap size in Android is 16 Mb (if i remember correctly). That's why the outofmemoryerror. Don't know why are you allocating that much memory though?? -Mika On Oct 1, 3:43 pm, Stefan wrote: > He

[android-developers] Re: java.lang.OutOfMemoryError after orientation changed

2009-10-01 Thread Stefan
Here my logcat: E/dalvikvm-heap( 961): Out of memory on a 167772196-byte allocation. I/dalvikvm( 961): "main" prio=5 tid=3 RUNNABLE I/dalvikvm( 961): | group="main" sCount=0 dsCount=0 s=N obj=0x4001ab08 self=0xbc60 I/dalvikvm( 961): | sysTid=961 nice=0 sched=0/0 handle=-1343996920 I/dalvi

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-04-27 Thread Streets Of Boston
I do this in my app as well, and it works fine using BitmapFactory. But i make sure that this large bitmap (full-size image, 6Mpix) is about the only one loaded in my application. If not, i get the same exception. Opening 2 of these large ones will give me this exception, whatever i do. On Apr 2

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-02-05 Thread Rohit
I've tried the unbind method and it doesnt seem to help my case :( It is a good thing to know and keep in mind. Rohit On Jan 23, 2:07 pm, JP wrote: > There's a bunch of discussions about this issue in this forum, just > dig a little and you will find what you need to know. > Also, Romain Guy p

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-01-23 Thread JP
There's a bunch of discussions about this issue in this forum, just dig a little and you will find what you need to know. Also, Romain Guy posted a write-up about un-binding views (and bitmaps) from activities. http://android-developers.blogspot.com/2009/01/avoiding-memory-leaks.html Admittedly,

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-01-23 Thread Mark K
It seems that there my be a bug, memory leak with the BitmapFactory when decoding, and reading bitmaps from file. I, and many other developers have noticed similar problems to what you describe. I haven't been able to get any official confirmation that this is a known bug, but it looks like a b