Giter VIP home page Giter VIP logo

Comments (2)

zengjingfang avatar zengjingfang commented on September 22, 2024

参考下这篇文章: https://www.jianshu.com/p/862ce91c1abf

from androidbox.

zengjingfang avatar zengjingfang commented on September 22, 2024

ANR WaitingForGcToComplete

----- pid 8638 at 2018-06-05 11:36:27 -----
Cmd line: com.xtc.watch
Build fingerprint: 'Xiaomi/sagit/sagit:8.0.0/OPR1.170623.027/V9.5.8.0.OCACNFA:user/release-keys'
ABI: 'arm'
Build type: optimized
Zygote loaded classes=4895 post zygote classes=5729
Intern table: 81637 strong; 243 weak
JNI: CheckJNI is off; globals=916 (plus 81 weak)
Libraries: /data/app/com.xtc.watch-i3gHJDmCFPHabPaHooYdCQ==/lib/arm/libBaiduMapSDK_base_v5_1_0.so /data/app/com.xtc.watch-i3gHJDmCFPHabPaHooYdCQ==/lib/arm/libBaiduMapSDK_map_v5_1_0.so /data/app/com.xtc.watch-i3gHJDmCFPHabPaHooYdCQ==/lib/arm/libagora-rtc-sdk-jni.so /data/app/com.xtc.watch-i3gHJDmCFPHabPaHooYdCQ==/lib/arm/libgifimage.so /data/app/com.xtc.watch-i3gHJDmCFPHabPaHooYdCQ==/lib/arm/libimagepipeline.so /data/app/com.xtc.watch-i3gHJDmCFPHabPaHooYdCQ==/lib/arm/liblocSDK7b.so /data/app/com.xtc.watch-i3gHJDmCFPHabPaHooYdCQ==/lib/arm/libmarsxlog.so /data/app/com.xtc.watch-i3gHJDmCFPHabPaHooYdCQ==/lib/arm/libsqlcipher.so /data/app/com.xtc.watch-i3gHJDmCFPHabPaHooYdCQ==/lib/arm/libstlport_shared.so /system/app/WebViewGoogle/WebViewGoogle.apk!/lib/armeabi-v7a/libwebviewchromium.so /system/lib/libandroid.so /system/lib/libaudioeffect_jni.so /system/lib/libcompiler_rt.so /system/lib/libjavacrypto.so /system/lib/libjnigraphics.so /system/lib/libmedia_jni.so /system/lib/libmiuiclassproxy.so /system/lib/libmiuinative.so /system/lib/libqti_performance.so /system/lib/libsoundpool.so /system/lib/libwebviewchromium_loader.so /system/lib/libwebviewchromium_plat_support.so libjavacore.so libopenjdk.so (24)
/data/data/com.xtc.watch/app_mpcd/oat/arm/mpcd.odex: quicken
/system/app/WebViewGoogle/oat/arm/WebViewGoogle.odex: quicken
/system/framework/oat/arm/volley.odex: quicken
/data/app/com.xtc.watch-i3gHJDmCFPHabPaHooYdCQ==/oat/arm/base.odex: quicken
Current JIT code cache size: 1474KB
Current JIT data cache size: 975KB
Current JIT capacity: 3MB
Current number of JIT code cache entries: 1352
Total number of JIT compilations: 1580
Total number of JIT compilations for on stack replacement: 1
Total number of JIT code cache collections: 11
Memory used for stack maps: Avg: 548B Max: 8KB Min: 24B
Memory used for compiled code: Avg: 1097B Max: 11KB Min: 2B
Memory used for profiling info: Avg: 190B Max: 66KB Min: 16B
Start Dumping histograms for 1594 iterations for JIT timings
Compiling:	Sum: 5.096s 99% C.I. 0.065ms-28.935ms Avg: 3.219ms Max: 1277.672ms
TrimMaps:	Sum: 102.057ms 99% C.I. 3us-704.250us Avg: 64.470us Max: 3276us
Code cache collection:	Sum: 12.883ms 99% C.I. 0.441ms-5.469ms Avg: 1.171ms Max: 5.658ms
Done Dumping histograms
Memory used for compilation: Avg: 209KB Max: 2MB Min: 15KB
ProfileSaver total_bytes_written=160593
ProfileSaver total_number_of_writes=1
ProfileSaver total_number_of_code_cache_queries=10
ProfileSaver total_number_of_skipped_writes=9
ProfileSaver total_number_of_failed_writes=0
ProfileSaver total_ms_of_sleep=355318
ProfileSaver total_ms_of_work=371
ProfileSaver max_number_profile_entries_cached=3
ProfileSaver total_number_of_hot_spikes=51
ProfileSaver total_number_of_wake_ups=32
Number of JIT inline cache deoptimizations: 45
Number of JIT same target deoptimizations: 9
Number of class hierarchy analysis deoptimizations: 1

suspend all histogram:	Sum: 12.086ms 99% C.I. 2us-3667.199us Avg: 134.288us Max: 4988us
DALVIK THREADS (91):
"Signal Catcher" daemon prio=5 tid=3 Runnable
  | group="system" sCount=0 dsCount=0 flags=0 obj=0x12c80388 self=0xefb10c00
  | sysTid=8644 nice=0 cgrp=default sched=0/0 handle=0xe5d7e970
  | state=R schedstat=( 0 0 0 ) utm=1 stm=7 core=0 HZ=100
  | stack=0xe5c84000-0xe5c86000 stackSize=1006KB
  | held mutexes= "mutator lock"(shared held)
  native: #00 pc 002c4913  /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+130)
  native: #01 pc 00355f9b  /system/lib/libart.so (_ZNK3art6Thread9DumpStackERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMapb+202)
  native: #02 pc 0035244d  /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMapb+36)
  native: #03 pc 0036a2f5  /system/lib/libart.so (_ZN3art14DumpCheckpoint3RunEPNS_6ThreadE+704)
  native: #04 pc 00363b77  /system/lib/libart.so (_ZN3art10ThreadList13RunCheckpointEPNS_7ClosureES2_b+566)
  native: #05 pc 003635b9  /system/lib/libart.so (_ZN3art10ThreadList4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEb+544)
  native: #06 pc 0036326b  /system/lib/libart.so (_ZN3art10ThreadList14DumpForSigQuitERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+650)
  native: #07 pc 0034088d  /system/lib/libart.so (_ZN3art7Runtime14DumpForSigQuitERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+112)
  native: #08 pc 0034775f  /system/lib/libart.so (_ZN3art13SignalCatcher13HandleSigQuitEv+1130)
  native: #09 pc 003469a9  /system/lib/libart.so (_ZN3art13SignalCatcher3RunEPv+240)
  native: #10 pc 0004841f  /system/lib/libc.so (_ZL15__pthread_startPv+22)
  native: #11 pc 0001b55d  /system/lib/libc.so (__start_thread+32)
  (no managed stack frames)

// WaitingForGcToComplete

"main" prio=5 tid=1 WaitingForGcToComplete
  | group="main" sCount=1 dsCount=0 flags=1 obj=0x747e4600 self=0xefb10000
  | sysTid=8638 nice=0 cgrp=default sched=0/0 handle=0xf34f14a8
  | state=S schedstat=( 0 0 0 ) utm=1218 stm=139 core=0 HZ=100
  | stack=0xff71f000-0xff721000 stackSize=8MB
  | held mutexes=
  kernel: (couldn't read /proc/self/task/8638/stack)
  native: #00 pc 00019118  /system/lib/libc.so (syscall+28)
  native: #01 pc 000b3c05  /system/lib/libart.so (_ZN3art17ConditionVariable16WaitHoldingLocksEPNS_6ThreadE+88)
  native: #02 pc 00192c23  /system/lib/libart.so (_ZN3art2gc4Heap25WaitForGcToCompleteLockedENS0_7GcCauseEPNS_6ThreadE+230)
  native: #03 pc 0019d63b  /system/lib/libart.so (_ZN3art2gc4Heap19WaitForGcToCompleteENS0_7GcCauseEPNS_6ThreadE+190)
  native: #04 pc 0019a2f3  /system/lib/libart.so (_ZN3art2gc4Heap22AllocateInternalWithGcEPNS_6ThreadENS0_13AllocatorTypeEbjPjS5_S5_PNS_6ObjPtrINS_6mirror5ClassEEE+78)
  native: #05 pc 003b3255  /system/lib/libart.so (artAllocArrayFromCodeResolvedRegionTLAB+520)
  native: #06 pc 003e0627  /system/lib/libart.so (art_quick_alloc_array_resolved16_region_tlab+86)
  native: #07 pc 000e6d33  /dev/ashmem/dalvik-jit-code-cache (deleted) (???)
  at java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:69)
  at java.lang.StringBuilder.<init>(StringBuilder.java:90)
  at com.xtc.watch.util.ForegroundUtil$1.handleMessage(ForegroundUtil.java:92)
  at android.os.Handler.dispatchMessage(Handler.java:101)
  at android.os.Looper.loop(Looper.java:164)
  at android.app.ActivityThread.main(ActivityThread.java:6665)
  at java.lang.reflect.Method.invoke(Native method)
  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:781)

// WaitingPerformingGc

"RxIoScheduler-33" daemon prio=5 tid=39 WaitingPerformingGc
  | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c87610 self=0xcae6c600
  | sysTid=9897 nice=0 cgrp=default sched=0/0 handle=0xca17f970
  | state=R schedstat=( 0 0 0 ) utm=2738 stm=119 core=6 HZ=100
  | stack=0xca07d000-0xca07f000 stackSize=1038KB
  | held mutexes= "mutator lock"(shared held)
  kernel: (couldn't read /proc/self/task/9897/stack)
  native: #00 pc 00178528  /system/lib/libart.so (_ZN3art2gc9collector17ConcurrentCopying7ProcessEPNS_6mirror6ObjectENS_12MemberOffsetE+235)
  native: #01 pc 00177ef7  /system/lib/libart.so (_ZN3art6mirror6Object15VisitReferencesILb1ELNS_17VerifyObjectFlagsE0ELNS_17ReadBarrierOptionE1ENS_2gc9collector17ConcurrentCopying16RefFieldsVisitorES8_EEvRKT2_RKT3_+70)
  native: #02 pc 001733fb  /system/lib/libart.so (_ZN3art2gc9collector17ConcurrentCopying19ProcessMarkStackRefEPNS_6mirror6ObjectE+98)
  native: #03 pc 00172f3b  /system/lib/libart.so (_ZN3art2gc9collector17ConcurrentCopying20ProcessMarkStackOnceEv+402)
  native: #04 pc 00172d9b  /system/lib/libart.so (_ZN3art2gc9collector17ConcurrentCopying16ProcessMarkStackEv+18)
  native: #05 pc 0016e555  /system/lib/libart.so (_ZN3art2gc9collector17ConcurrentCopying12MarkingPhaseEv+456)
  native: #06 pc 0016db35  /system/lib/libart.so (_ZN3art2gc9collector17ConcurrentCopying9RunPhasesEv+540)
  native: #07 pc 0017cbc5  /system/lib/libart.so (_ZN3art2gc9collector16GarbageCollector3RunENS0_7GcCauseEb+268)
  native: #08 pc 001979ef  /system/lib/libart.so (_ZN3art2gc4Heap22CollectGarbageInternalENS0_9collector6GcTypeENS0_7GcCauseEb+2726)
  native: #09 pc 0019a5d3  /system/lib/libart.so (_ZN3art2gc4Heap22AllocateInternalWithGcEPNS_6ThreadENS0_13AllocatorTypeEbjPjS5_S5_PNS_6ObjPtrINS_6mirror5ClassEEE+814)
  native: #10 pc 003b3009  /system/lib/libart.so (artAllocObjectFromCodeInitializedRegionTLAB+228)
  native: #11 pc 003e036b  /system/lib/libart.so (art_quick_alloc_object_initialized_region_tlab+74)
  native: #12 pc 0014cca5  /dev/ashmem/dalvik-jit-code-cache (deleted) (???)
  at android.support.v7.widget.OrientationHelper.createHorizontalHelper(OrientationHelper.java:258)
  at android.support.v7.widget.OrientationHelper.createOrientationHelper(OrientationHelper.java:243)
  at android.support.v7.widget.StaggeredGridLayoutManager.createOrientationHelpers(StaggeredGridLayoutManager.java:264)
  at android.support.v7.widget.StaggeredGridLayoutManager.<init>(StaggeredGridLayoutManager.java:253)
  at com.xtc.watch.view.weichat.view.InputMethodView$6.a(InputMethodView.java:363)
  at com.xtc.watch.view.weichat.view.InputMethodView$6.call(InputMethodView.java:328)
  at rx.internal.operators.OnSubscribeLift.a(OnSubscribeLift.java:48)
  at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
  at rx.Observable.a(Observable.java:10151)
  at rx.internal.operators.OperatorSubscribeOn$1.call(OperatorSubscribeOn.java:94)
  at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:228)
  at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
  at java.lang.Thread.run(Thread.java:764)

分析方法

先找到main线程

发现 WaitingForGcToComplete

此刻继续搜索“WaitingPerformingGc”

找到对应的栈

at android.support.v7.widget.OrientationHelper.createHorizontalHelper(OrientationHelper.java:258)
  at android.support.v7.widget.OrientationHelper.createOrientationHelper(OrientationHelper.java:243)
  at android.support.v7.widget.StaggeredGridLayoutManager.createOrientationHelpers(StaggeredGridLayoutManager.java:264)
  at android.support.v7.widget.StaggeredGridLayoutManager.<init>(StaggeredGridLayoutManager.java:253)
  at com.xtc.watch.view.weichat.view.InputMethodView$6.a(InputMethodView.java:363)

RxIoScheduler-33 线程横竖屏切换、输入法GC时block了主线程申请内存

from androidbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.