Whenever i change orientation or Pressing BACK button.

"HeapWorker" thread taking 75-85% of CPU, then entire system is
getting blocked.

But if i don't change orientation or don't press BACK it is working
properly.

How to solve this problem?

Where is the problem?

My log as follows:

 GC freed 921 objects / 39096 bytes in 380ms
W/WindowManager(  199): Key dispatching timed out sending to hs.com/
hs.com.sampleGUI
W/WindowManager(  199): Dispatch state: {{KeyEvent{action=0 code=4
repeat=0 meta=0 scancode=158 mFlags=8} to Window{43a298e8 hs.com/
hs.com.sampleGUI paused=false} @ 1260963980348 lw=Window{43a298e8
hs.com/hs.com.sampleGUI paused=false}
lb=android.os.binderpr...@439f4ce8 fin=false gfw=true ed=true tts=0
wf=true fp=false mcf=Window{43a298e8 hs.com/hs.com.sampleGUI
paused=false}}}
W/WindowManager(  199): Current state:  {{KeyEvent{action=1 code=4
repeat=0 meta=0 scancode=158 mFlags=8} to Window{43a298e8 hs.com/
hs.com.sampleGUI paused=false} @ 1260963990515 lw=Window{43a298e8
hs.com/hs.com.sampleGUI paused=false}
lb=android.os.binderpr...@439f4ce8 fin=false gfw=true ed=true tts=0
wf=false fp=false mcf=Window{43a298e8 hs.com/hs.com.sampleGUI
paused=false}}}
I/ActivityManager(  199): ANR (application not responding) in process:
hs.com
I/ActivityManager(  199): Annotation: keyDispatchingTimedOut
I/ActivityManager(  199): CPU usage:
I/ActivityManager(  199): Load: 5.24 / 3.94 / 1.91
I/ActivityManager(  199): CPU usage from 12924ms to 49ms ago:
I/ActivityManager(  199):   hs.com: 71% = 68% user + 3% kernel
I/ActivityManager(  199):   top: 10% = 3% user + 7% kernel
I/ActivityManager(  199):   top: 5% = 1% user + 3% kernel
I/ActivityManager(  199):   tiwlan_wifi_wq: 2% = 0% user + 2% kernel
I/ActivityManager(  199):   system_server: 2% = 2% user + 0% kernel
I/ActivityManager(  199):   adbd: 1% = 0% user + 1% kernel
I/ActivityManager(  199):   akmd: 0% = 0% user + 0% kernel
I/ActivityManager(  199):   dhcpcd: 0% = 0% user + 0% kernel
I/ActivityManager(  199):   kondemand/0: 0% = 0% user + 0% kernel
I/ActivityManager(  199):   init: 0% = 0% user + 0% kernel
I/ActivityManager(  199):   events/0: 0% = 0% user + 0% kernel
I/ActivityManager(  199):   kswapd0: 0% = 0% user + 0% kernel
I/ActivityManager(  199):   wpa_supplicant: 0% = 0% user + 0% kernel
I/ActivityManager(  199):  +dhcpcd-run-hook: 0% = 0% user + 0% kernel
I/ActivityManager(  199):  +<unknown>: 0% = 0% user + 0% kernel
I/ActivityManager(  199): TOTAL: 99% = 79% user + 20% kernel
I/ActivityManager(  199): Removing old ANR trace file from /data/anr/
traces.txt
I/Process (  199): Sending signal. PID: 504 SIG: 3
I/dalvikvm(  504): threadid=7: reacting to signal 3
I/Process (  199): Sending signal. PID: 450 SIG: 3
I/dalvikvm(  450): threadid=7: reacting to signal 3
I/Process (  199): Sending signal. PID: 234 SIG: 3
I/dalvikvm(  234): threadid=7: reacting to signal 3
I/Process (  199): Sending signal. PID: 458 SIG: 3
I/dalvikvm(  458): threadid=7: reacting to signal 3
I/Process (  199): Sending signal. PID: 291 SIG: 3
I/dalvikvm(  291): threadid=7: reacting to signal 3
I/Process (  199): Sending signal. PID: 280 SIG: 3
I/dalvikvm(  280): threadid=7: reacting to signal 3
I/Process (  199): Sending signal. PID: 366 SIG: 3
I/dalvikvm(  366): threadid=7: reacting to signal 3
I/Process (  199): Sending signal. PID: 352 SIG: 3
I/dalvikvm(  352): threadid=7: reacting to signal 3
I/Process (  199): Sending signal. PID: 199 SIG: 3
I/dalvikvm(  199): threadid=7: reacting to signal 3
I/dalvikvm(  291): Wrote stack trace to '/data/anr/traces.txt'
I/dalvikvm(  280): Wrote stack trace to '/data/anr/traces.txt'

And the taces.txt is

DALVIK THREADS:
"main" prio=5 tid=3 WAIT
  | group="main" sCount=1 dsCount=0 s=0 obj=0x40018e70
  | sysTid=291 nice=0 sched=0/0 handle=-1090933604
  at java.lang.Object.wait(Native Method)
  - waiting on <0x1a84e8> (a android.os.MessageQueue)
  at java.lang.Object.wait(Object.java:288)
  at android.os.MessageQueue.next(MessageQueue.java:148)
  at android.os.Looper.loop(Looper.java:110)
  at android.app.ActivityThread.main(ActivityThread.java:3948)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:521)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:782)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
  at dalvik.system.NativeStart.main(Native Method)

"Binder Thread #4" prio=5 tid=21 NATIVE
  | group="main" sCount=1 dsCount=0 s=0 obj=0x43908a68
  | sysTid=449 nice=0 sched=0/0 handle=1918536
  at dalvik.system.NativeStart.run(Native Method)

"album thumbs" prio=1 tid=17 WAIT
  | group="main" sCount=1 dsCount=0 s=0 obj=0x438d6460
  | sysTid=307 nice=19 sched=0/0 handle=1733072
  at java.lang.Object.wait(Native Method)
  - waiting on <0x1a75a0> (a android.os.MessageQueue)
  at java.lang.Object.wait(Object.java:288)
  at android.os.MessageQueue.next(MessageQueue.java:148)
  at android.os.Looper.loop(Looper.java:110)
  at com.android.providers.media.MediaProvider$Worker.run
(MediaProvider.java:1713)
  at java.lang.Thread.run(Thread.java:1058)
  "Binder Thread #3" prio=5 tid=15 NATIVE
  | group="main" sCount=1 dsCount=0 s=0 obj=0x438b8b40
  | sysTid=299 nice=0 sched=0/0 handle=1309400
  at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #2" prio=5 tid=13 NATIVE
  | group="main" sCount=1 dsCount=0 s=0 obj=0x438b3ee0
  | sysTid=298 nice=0 sched=0/0 handle=1310720
  at dalvik.system.NativeStart.run(Native Method)

"Binder Thread #1" prio=5 tid=11 NATIVE
  | group="main" sCount=1 dsCount=0 s=0 obj=0x438b19b0
  | sysTid=297 nice=0 sched=0/0 handle=1315624
  at dalvik.system.NativeStart.run(Native Method)

"JDWP" daemon prio=5 tid=9 VMWAIT
  | group="system" sCount=1 dsCount=0 s=0 obj=0x438b02a0
  | sysTid=294 nice=0 sched=0/0 handle=1314816
  at dalvik.system.NativeStart.run(Native Method)

"Signal Catcher" daemon prio=5 tid=7 RUNNABLE
  | group="system" sCount=0 dsCount=0 s=0 obj=0x438b01e8
  | sysTid=293 nice=0 sched=0/0 handle=1314048
  at dalvik.system.NativeStart.run(Native Method)

"HeapWorker" daemon prio=5 tid=5 VMWAIT
  | group="system" sCount=1 dsCount=0 s=0 obj=0x42af3e58
  | sysTid=292 nice=0 sched=0/0 handle=1311408
  at dalvik.system.NativeStart.run(Native Method)












On Dec 16, 1:32 pm, pink 444 <[email protected]> wrote:
> Thanks for your prompt replay.
>
> May  I know the scenarios when GC will be triggered......
>
> I'm using intents very frequently, will it cause GC to trigger ?
>
> I have so many threads in my native code,which is being used by my
> application but i
>
> cannot find those names , instead i am getting Thread-9 ,that count is
> around 10 .
>
>   My application is using "__android_log_print" extensively.
>
> On Dec 16, 11:30 am, Dianne Hackborn <[email protected]> wrote:
>
> > It runs finalizers.  You probably are either causing the gc to run (you can
> > tell from the log) or have some finalizer getting stuck (look at the threads
> > in the debugger).
>
> > On Tue, Dec 15, 2009 at 10:25 PM, pink 444 <[email protected]> wrote:
> > > Hi all,
>
> > >         What is "Heap Worker" thread ?
>
> > >         What does it do?
>
> > >          In my application's HeapWorker thread is taking most of the
> > > CPU around 80%.
> > >          How can i reduce this usage Percentage?
>
> > >  Any help would be appreciated highly.
>
> > > --
> > > 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]<android-developers%[email protected]>
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
> > --
> > 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, and so won't reply to such e-mails.  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