Wednesday, November 16, 2011

Re: [android-developers] Speed up dalvikvm calls

On 16 November 2011 15:48, New Developer <security@isscp.com> wrote:
> Hi all,
>
> I have a runnable thread which is called  every  5 ms
>    mHandler.postDelayed(buffering, 5);
>
> Yet from the LogCat it is taking much longer.
>
> 11-16 10:32:14.110: D/dalvikvm(1945): GC_FOR_ALLOC freed 1801K, 16% free
> 23172K/27463K, paused 25ms
> 11-16 10:32:14.420: D/dalvikvm(1945): GC_FOR_ALLOC freed 1801K, 16% free
> 23172K/27463K, paused 25ms
> 11-16 10:32:14.720: D/dalvikvm(1945): GC_FOR_ALLOC freed 1801K, 16% free
> 23172K/27463K, paused 24ms
> 11-16 10:32:15.030: D/dalvikvm(1945): GC_FOR_ALLOC freed 1801K, 16% free
> 23172K/27463K, paused 25ms
> 11-16 10:32:15.330: D/dalvikvm(1945): GC_FOR_ALLOC freed 1801K, 16% free
> 23172K/27463K, paused 25ms
>
> Is there a method to speed up this call and reduce the paused 25ms  time ?
>


There should be a TURBO option in the phone somewhere.

But honestly you creating 1.8MB of garbage (dereferenced objects) 3
times within each second, so your GC runs like crazy.

Things to look at:

- Avoid repeated string concatenation
- Pre-size your collection data structures
- Keep caches of frequently-used values rather
than reallocating them
- Eliminate references to objects promptly when
you no longer need them.

--
Daniel Drozdzewski

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate