Android :: Garbage Collection Infinite Loop - Clamp GC FOR MALLOC Grow Heap
Jul 6, 2010
I have a Service which uploads a big file to a webserver. This works fine on the emulator (android 2.1). But if i run it on a Nexus One Froyo phone it starts out fine. But after a while it is in an infinite GC loop. The whole phone becomes unusable:.........................
View 5 Replies
Jun 6, 2010
I'm writing an Augmented Reality codes that should works in realtime,
But the VM's garbage collection hinders my program's performance.
I checked my program's execution time for each in OnPrevFrame(byte[], Camera)
and it execution time increases from around 50ms to 120ms at just after each garbage collection.
I copied parts of logs below. (local time is just before and after of signal processing, and global time is time stamps for every onPreviewFrame() calling )Also I executed onPreviewFrame without any signal processing on it, but
the garbage collection is also carried showing debugging message around 60ms it spends for memory release.
Is this garbage collection come from releasing byte[] yuvs image data? ( i uses 320x240 thumb nail )
then this clearly comes from Java's limitation, so there will be no hope for improvement unless
I found a way to directly access camera device? do you think this is feasible? Hope listen to others' comments.
View 3 Replies
View Related
Dec 28, 2009
I'm drawing a rect to a surfaceview. Nothing special, just a test like this, in the surfaceview-extended class:
private int mPosX = 0; private Paint mPaint = new Paint(); Code...
the rect just bounces around the screen. I'm watching DDMS, I still see the garbage collector being called, even with this simple draw loop. There is no other application code being executed.
I'm wondering if it's realistic to expect the gc to not be called at all if we take care to not allocate any objects during our draw loops. I'm trying to extend this example to do some smooth animations, but every once in awhile the gc is called and you can see the drawing stutter. Although none of my application code is allocating any new objects, I don't know what the underlying API is doing inside surfaceview etc, and I doubt we can control that. Just wondering if this is not possible, I'd prefer to abandon this game idea up-front if we can't guarantee smooth animation.
View 5 Replies
View Related
May 25, 2009
I am developing a camera application , where the frame rate is important. However, camera uses a preview callback function which allocates a byte[] array of 230400 bytes, which makes it necessary for the garbage collection to step in. Can someone suggest me a way to avoid garbage collection stepping in?
View 10 Replies
View Related
May 20, 2009
Hi, I have discovered while using DDMS that the basic OpenGL system calls in my code are allocating memory and causing the garbage collector to fire! It's not the system calls themselves causing the problem but the use of direct byte buffers to pass data in.
The direct byte buffers I use in calls such as glVertexPointer & glTexCoordPointer lead to java.nio calls to read the byte buffers, leading to objects of type org.apache.harmony.luni.platform.PlatformAddress being created.
These buffers are the same as in the example OpenGL code. I am creating a ByteBuffer using allocateDirect() and then creating an IntBuffer using ByteBuffer.asIntBuffer() to pass data to the OpenGL functions. The problem occurs as the system is reading the buffers.
Is there a way around this? Maybe using something other than direct byte buffers? It seems that using this method, OpenGL code of any complexity (ie a lot of OpenGL system calls in every frame) is doomed to pause a lot. I am aware that these calls should be kept to a minimum, but I still need to use a certain amount of them.
View 9 Replies
View Related
Mar 20, 2010
I'm performance tuning interactive games in Java for the Android platform. Once in a while there is a hiccup in drawing and interaction for garbage collection. Usually it's less than one tenth of a second, but sometimes it can be as large as 200ms on very slow devices. I am using the ddms profiler (part of the Android SDK) to search out where my memory allocations come from and excise them from my inner drawing and logic loops. The worst offender had been short loops done like,
for(GameObject gob : interactiveObjects)
gob.onDraw(canvas);........................
View 3 Replies
View Related
Apr 15, 2009
I have screen 1 of my app which I want to transition smoothly into screen 2.
I want the transition to be smooth but I don't mind a slight pause before or after the transition. Before the transition I dump a lot of objects that are no longer needed from screen 1.
However, as luck would have it (!), the garbage collection almost always takes place during the transition causing the frame rate to drop and the transition looks terrible :(
Is there a way for me to either force the garbage collection to complete before the transition or delay until after the transition is finished? I have tried System.gc() in various places but it doesn't seem to help performance.
View 2 Replies
View Related
Apr 13, 2009
In my ListView, there's one line of code in my ViewBinder that causes lots of garbage collection as I scroll through the list, about every two seconds...
D/dalvikvm(16312): GC freed 13171 objects / 659576 bytes in 162ms D/dalvikvm(16312): GC freed 13122 objects / 654128 bytes in 129ms D/dalvikvm(16312): GC freed 13134 objects / 655416 bytes in 142ms D/dalvikvm(16312): GC freed 13129 objects / 654840 bytes in 129ms D/dalvikvm(16312): GC freed 13149 objects / 655000 bytes in 110ms D/dalvikvm(16312): GC freed 13150 objects / 655720 bytes in 127ms D/dalvikvm(16312): GC freed 13075 objects / 652256 bytes in 111ms D/dalvikvm(16312): GC freed 13232 objects / 659040 bytes in 136ms D/dalvikvm(16312): GC freed 13106 objects / 653920 bytes in 110ms D/dalvikvm(16312): GC freed 13155 objects / 655152 bytes in 110ms
The offending code is here, which formats a price for each item in the list: String price = cursor.getString(columnIndex); final float pricef = Float.parseFloat(price); price = new StringBuffer("$").append(String.format("%. 2f",pricef)).toString(); ((TextView)view).setText(price);
If I comment out the line with String.format, the garbage collection goes away. So what's the "right" way to do this to avoid allocations? That database field holds an unformatted text string which I'm trying to format into proper currency format (example: format "1.5" to "$1.50")
View 9 Replies
View Related
Oct 13, 2010
I am trying to implement simple user input validation in EditText, something like
setText("type your password:") ... if ( user input != "secretword")
setText("incorrect, try again: ")
So i am using "onTextChanged" to validate keyboard input, but how can i set the text without going to infinite loop? code...
View 7 Replies
View Related
Mar 3, 2012
Side scrolling infinite loop swipe menu?
I have a picture here explaining what i am trying to achieve.
View 9 Replies
View Related
Oct 16, 2010
My Incred is on an infinite loop on all the startup screens. Just keeps saying droid and then the HTC brilliant screen and such over and over. This is the 2nd time it happened to me. First was replaced at no cost to me though some inconvenience. Problem is I have some pics/vids on the phone memory that I would like to grab before returning the phone again. Can anybody think of a way I could accomplish this? Would a verizon tech be any help? Just a few vids of my son that I would prefer to keep. Nothing life changing. I plugged the phone into the computer and looked for the drives on 'my computer'. They were listed but empty. I guess the phone keeps rebooting before they can be populated with stuff. Any shot of me getting a DX in replacement? Love my Dinc but have screen (size) envy.
View 2 Replies
View Related
Nov 2, 2009
I am trying to make ListView which should display data from db. But the db is filled slowly so want the entries in the ListView to grow dynamically according to the elements in db. For example on a desktop music player when you import a folder to the music library the list with songs is filling in real time with the newly added songs. So how can i get this working on android.
View 5 Replies
View Related
Apr 19, 2010
I want my view to grow or shrink in one direction like curtains. What animation i can use for this? is this scalling or wht is it ?
View 3 Replies
View Related
Jul 7, 2009
Is there a way to grow the progress bar from the middle and in both directions? Something like below:
CODE:.............................
View 3 Replies
View Related
Mar 15, 2010
I have a fairly complex activity the parent being a linearlayout with a table with some basic info and buttons. Then a couple listviews that the user can add items to. So these listviews grow more and more as the user uses the app. The problem I'm running into is the Linearlayout is bigger then the resolution of the screen and so it needs to scroll. So the scrolling doesn't work on the Listviews. I've tried playing with changing the layout_height of the listview and its child element with no success. Is there a way to make these couple listviews expand out to the amount of children? Or am I going about this all wrong? If so what other controls can I use?
View 1 Replies
View Related
Oct 12, 2010
I have an ImageView on which I have applied rotate animation. Since I want the rotation to go on continuously, I gave the repeatCount as infinite in my rotate.xml
android:repeatCount="infinite"
In onCreate(), I load the animation and start it.
Animation myAnim = AnimationUtils.loadAnimation(this, R.anim.rotate);
objectImg.startAnimation(myAnim);
When a button is pressed, the rotation must stop. Hence in my onClick(), I called clearAnimation().
objectImg.startAnimation(myAnim);
My simple doubt is whether it's the right thing to do, to stop the animation?
I assume clearAnimation() is to loadAnimation(), but there is no stopAnimation() corresponds to startAnimation().
View 2 Replies
View Related
Dec 23, 2009
I've been doing a lot of searching and I know a lot of other people are experiencing the same OOM memory problems with BitmapFactory. My app only shows a total memory available of 4MB using Runtime. getRuntime ().totalMemory(). If the limit is 16MB, then why doesn't the total memory grow to make room for the bitmap? Instead it throws an error.............
View 1 Replies
View Related
May 27, 2010
I have an app with about 15 threads. Most do mundane tasks and sleep most of their lives. Others collect information and cache it in hashmaps. The hashmaps grow to a moderate size and level out. The number of keys and size of value remains constant, but the contents of the values changes (at 33 keys per second average). When I start my app, I notice the garbage collection interval goes from minutes to once per second, and the amount of garbage is 700k+ each time. In fact as I was writing this, it caused my phone to reboot with an error "Referencetable Overflow". Here's my question: Are there any tricks to identifying which threads are producing the garbage, or even finding out more about what garbage they are producing?
05-26 22:08:57.052 W/dalvikvm( 1031): ReferenceTable overflow (max=512)
05-26 22:08:57.052 W/dalvikvm( 1031): Last 10 entries in JNI local reference table:
05-26 22:08:57.052 W/dalvikvm( 1031): 502: 0x449904a8 cls=Ljava/lang/String; (28 bytes)
05-26 22:08:57.052 W/dalvikvm( 1031): 503: 0x4494fda8 cls=Ljava/lang/String; (28 bytes)
05-26 22:08:57.052 W/dalvikvm( 1031): 504: 0x44a172c8 cls=Ljava/lang/String; (28 bytes)
05-26 22:08:57.052 W/dalvikvm( 1031): 505: 0x448c7900 cls=Ljava/lang/String; (28 bytes)........
View 2 Replies
View Related
Jun 9, 2014
I searched the forums, looked like everyone who had this problem rooted their phones and installed custom roms, however i did not tamper with the phone in anyway, no rooting or custom rom, just nothing, this is the 3rd time in 6 weeks i get stuck in an infinite restart loop, i did two factory resets and i can't just do another one.
So far i have tried:
1-installing an antivirus and scanning (nothing found)
2-restarting in safe mode, the phone continued to restart in safe mode
3-uninstalled new apps that i installed recently
there has to be a way!!
View 9 Replies
View Related
Jan 5, 2010
Just gotta say that they are in for a hell of a ride. The N1 looks to be an awesome device and they are going to get to have the kind of fun we've all been having with a spanking fast shiny new Android phone.More than that I'm really excited to see this tsunami of sweet Android devices to hit the market.It doesn't take much imagination to realize how much the Market is going to grow with quality apps.
That said, I'm still very happy with my Droid AND a little bit jealous of the N1 already, all at the same time. I may even buy it at some point in the coming months, but most of all, this is exciting news for the platform we all know rocks
View 49 Replies
View Related
Feb 11, 2010
Was looking for some guidance here. I need to replace the garbage keyboard bundled with 1.6 for something else. Which in your opinion is the best replacement and why? Maybe some comparisons would help also. Oh, by the way i'm running a mytouch 3g!
View 28 Replies
View Related
Jul 29, 2009
I didn't use much Java before Android so my knowledge concerning the gc is marginal. Now I'm developing a highly physics-based game and therefore I need to do many calculations each time step and many (25) time steps per second. At the moment I'm almost only using local objects (float) in my methods, so I guess they are allocated every time the method is called (which might be, for example, 25*100 = 2500 times a second , for 100 objects with calculations on them). This causes massive activity of the garbage collector like freeing ~10000 objects every 1-2 seconds (taking ~200ms on a real device). Now I really want to optimize that because even there's no noticeable delay due to the GC (and the frame rate is constant), this seems just not well. But I read on many documentations concerning Java optimization, that there is not much to optimize in modern versions of (desktop) Java, because the GC is fast enough. Does this apply to Android, too? Does the compiler optimize anything like frequently, steady allocated objects (like floats)? What would be best practice: keep all local objects and allocate and free them all the time or use class-global objects, even if they are only used inside one particular method (which is bad programming style but conserves GC?
View 5 Replies
View Related
May 21, 2010
Is there any way to stop the garbage collector for some time?
View 2 Replies
View Related
Oct 8, 2010
Is there a way to play the music on my phone through my Infinite G37?
There's a USB input in the center console, which works great with my wifes Ipod, but when I plug my incredible into my car using my usb cable, i can't seem to get it to work.
I've tried it in charger mode, as well as mounted, and no dice.
View 11 Replies
View Related
Nov 10, 2009
Device: Motorola DROID
I just wanted to post an issue I found. I downloaded ES File Explorer and was browsing a shared folder of pictures on a desktop. I selected a picture and, with the file explorer's picture viewer, browsed the next few pictures sequentially. I found one that I wanted to use as a background, so with a menu option, I chose set as background. The device froze, and started a never ending reboot cycle. I had to hard reset the device and wipe it with the POWER + X button option. I am not sure if this is an ES File Explorer problem or a problem with file transfers initiated some way other than copy and paste, or just simply trying to assign a remote path as a background image location, but I thought it necessary to post. I have sent this to the author of the file manager as well.
View 3 Replies
View Related
Aug 1, 2010
I'm trying to update part of a VBO with a call to glBufferSubData(). When I update from the start (0) of my existing shadow buffer, there is no problem, as the buffer starts reading from 0. The following will read 0 to y from the buffer and place it at 0 to y in the VBO: gl.glBufferSubData(GL11.GL_ARRAY_BUFFER, 0, y, mPositionBuffer);
However, if I want to update a portion of the VBO (not from 0) I run into a problem; The following doesn't work, since it will write the values from the start of the buffer (0 to y) into position x to x+y of the VBO:........................
View 1 Replies
View Related
Mar 18, 2010
I know this may be a dumb question, but my background is more in c++ and managing my own memory.
I am currently cutting down every single allocation that I can from one of my games to try and reduce the frequency of garbage collection and perceived "lag", so for every variable that I create that is an Object (String for example) I am making sure that I create it before hand in my constructor and not create temporary variables in simple 10 line functions... (I hope that makes sense)
Anyways I was working though it some more tonight and I realized that I a may be completely wrong about my assumption on garbage collection and primitive types (int, boolean, float) are these primitive type variables that I create in a 10 line function that gets called 20 times a second adding to my problem of garbage collection?
View 2 Replies
View Related
Jul 20, 2013
My phone is not opening but I can still go to DOWNLOAD MODE
Solution I tried: I flash a stock firmware thru Odin and still it boots loop.
Maybe I can fix this problem of mine when I go to recovery mode, but how can I enter CWM recovery mode?
Phone Model: GT-S5570
View 1 Replies
View Related
Jun 4, 2010
I have a particular collection of code along with some XML files that I need to share with every application I will make.
At the moment I can't because as far as I am aware there is no way to do this. This seems like a massive oversight by the development team.
If the code needs changing, I have to change it in every app that I create - and will create in the future.
Are there any ways to share code in android yet? I am using Eclipse for development.
View 3 Replies
View Related
Jul 17, 2009
What would be the best way to access the USB as a serial port on a android device (HTC Magic) ?
I am thinking about a OBD-II interface, can I do this on a startdard phone or more likely I'll need a modified firmware ?
View 7 Replies
View Related