On Thu, Mar 5, 2009 at 5:29 AM, patg <[email protected]> wrote:

> I am curious why garbage collection is so frequent and so expensive.


Probably because you are allocating too many objects.  If it is causing you
problems, you should start looking at temporary objects and such that your
app is allocating.  Not only will this reduce the amount of garbage
collection, it will generally speed up your app because it is doing less
work.

The typical GC activity takes a little more than 100ms
> which seems like an very long time on a 500 Mhz processor (50 million
> instructions).  I would think you should be able to get it done in
> under 1 millisecond.


Um.  It takes on the order of 1 ms just to do an IPC across processes.
Also:

1. The CPU is not running at 500 MHz.
2. Garbage collection is very memory bus bound, and the memory bus is going
a fair amount slower (and in general memory buses on mobile devices are far
slower than what you may expect from experience on desktop systems).

-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

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

Reply via email to