[android-developers] Re: :: using System.gc();

2008-12-25 Thread Guillaume Perrot
My problem is that I display dynamic images (buddy's avatars) which size can reach 128*128 but I down sample them into 64*64 so I can't use static members for them. A background thread (a single threaded ExecutorService) is responsible for producing the 64*64 thumbnails, using BitmapFactory. When

[android-developers] Re: :: using System.gc();

2008-12-24 Thread freepine
Hi JP, Yes, I agree to avoid time-consuming tasks in main thread:)What I am saying is that mostly GC will hold the whole process' execution while collecting memory, so it might not behave as you assumed even you put it in a separate thread. -freepine On Wed, Dec 24, 2008 at 1:37 PM, JP

[android-developers] Re: :: using System.gc();

2008-12-24 Thread JP
Freepine might be right - I just toyed a little to see if there's any match between garbage collection and the scrolling (of a map). I am spreading garbage collection pretty wide however and it occurs at a time when it does not affect the user experience much, so it goes unnoticed. So you will

[android-developers] Re: :: using System.gc();

2008-12-23 Thread JP
Depends where it's placed at. I calls to the GC scattered all over, but with discretion. I made a concious design decision to avoid allocating memory in the presentation layer which is handling user interactions. I rely on a separate thread to handle all back end activities such as capturing and

[android-developers] Re: :: using System.gc();

2008-12-23 Thread freepine
I was thinking that Dalvik GC was the stop-the-world GC. Does it matter to call gc manually in a seperate thread or UI thread itself? -freepine On Wed, Dec 24, 2008 at 2:49 AM, JP joachim.pfeif...@gmail.com wrote: Depends where it's placed at. I calls to the GC scattered all over, but with

[android-developers] Re: :: using System.gc();

2008-12-23 Thread JP
My approach is to relief the main thread from any heavy lifting; calling web servers, processing data and preparing data structures. Calls to web servers should also not be made directly from the main thread. All that helps a great deal to keep the app responsive. Correction: Is essential to keep

[android-developers] Re: :: using System.gc();

2008-12-22 Thread sylvek
i don't know.. but you not be able to use this command :-/ On 22 déc, 08:34, Imran imran...@gmail.com wrote: Hi     hey  can  i use System.gc()  in my activity to request for garbage collection.      will it work () ..   will the garbage collector be called ?   Thanks in Advance for any

[android-developers] Re: :: using System.gc();

2008-12-22 Thread Dan Bornstein
On Sun, Dec 21, 2008 at 11:34 PM, Imran imran...@gmail.com wrote: hey can i use System.gc() in my activity to request for garbage collection. will it work () .. will the garbage collector be called ? Yes it will. However, let me warn you that in my experience adding explicit calls