Android ANR Trace日志阅读分析技巧

news2024/12/25 3:26:47

什么是Trace日志

Trace日志是指ANR目录下的一份txt文件

 adb pull /data/anr/traces.txt 

Trace日志有什么用

分析应用ANR无响应的问题,

Trace怎么用

Cmd line: com.xx
ABI: arm
Build type: optimized
Zygote loaded classes=3682 post zygote classes=3750
Intern table: 53619 strong; 1992 weak
JNI: CheckJNI is off; globals=889 (plus 1 weak)
Libraries: /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/librs_jni.so /system/lib/libsoundpool.so /system/lib/libwebviewchromium_loader.so /system/priv-app/com.xx/lib/arm/liball-in-one.so /system/priv-app/com.xx/lib/arm/libeffect_proxy.so /system/priv-app/com.xx/lib/arm/libhaierjniSystemUtils.so /system/priv-app/com.xx/lib/arm/libjcore216.so /system/priv-app/com.xx/lib/arm/libpl_droidsonroids_gif.so libjavacore.so (15)
Heap: 1% free, 23MB/23MB; 245425 objects
Dumping cumulative Gc timings
Start Dumping histograms for 11 iterations for concurrent mark sweep
ProcessMarkStack:        Sum: 121.875ms 99% C.I. 0.003ms-29.281ms Avg: 3.693ms Max: 30.497ms
UpdateAndMarkImageModUnionTable:        Sum: 27.838ms 99% C.I. 0.781ms-6.128ms Avg: 2.530ms Max: 6.128ms
MarkConcurrentRoots:        Sum: 17.482ms 99% C.I. 4us-2595.500us Avg: 794.636us Max: 2670us
SweepMallocSpace:        Sum: 6.778ms 99% C.I. 3us-2167us Avg: 308.090us Max: 2183us
MarkRootsCheckpoint:        Sum: 2.782ms 99% C.I. 38us-867.499us Avg: 126.454us Max: 932us
ScanGrayAllocSpaceObjects:        Sum: 2.776ms 99% C.I. 0.392us-916us Avg: 126.181us Max: 916us
ImageModUnionClearCards:        Sum: 2.174ms 99% C.I. 76us-250us Avg: 98.818us Max: 250us
ScanGrayImageSpaceObjects:        Sum: 1.710ms 99% C.I. 89us-802us Avg: 155.454us Max: 802us
(Paused)ScanGrayImageSpaceObjects:        Sum: 1.586ms 99% C.I. 88us-667us Avg: 144.181us Max: 696us
ScanGrayZygoteSpaceObjects:        Sum: 1.564ms 99% C.I. 294us-680us Avg: 391us Max: 680us
MarkAllocStackAsLive:        Sum: 1.474ms 99% C.I. 24us-484us Avg: 134us Max: 484us
MarkNonThreadRoots:        Sum: 1.361ms 99% C.I. 13us-119us Avg: 61.863us Max: 119us
EnqueueFinalizerReferences:        Sum: 1.035ms 99% C.I. 4us-468us Avg: 94.090us Max: 468us
AllocSpaceClearCards:        Sum: 1.015ms 99% C.I. 0.289us-87us Avg: 23.068us Max: 87us
ReMarkRoots:        Sum: 909us 99% C.I. 42us-134us Avg: 82.636us Max: 134us
ZygoteModUnionClearCards:        Sum: 627us 99% C.I. 43us-232us Avg: 78.375us Max: 232us
SweepSystemWeaks:        Sum: 606us 99% C.I. 16us-230us Avg: 55.090us Max: 230us
FinishPhase:        Sum: 497us 99% C.I. 36us-63us Avg: 45.181us Max: 63us
(Paused)ScanGrayAllocSpaceObjects:        Sum: 465us 99% C.I. 0.261us-106us Avg: 21.136us Max: 106us
SweepZygoteSpace:        Sum: 373us 99% C.I. 84us-110us Avg: 93.250us Max: 110us
SwapBitmaps:        Sum: 195us 99% C.I. 10us-31us Avg: 17.727us Max: 31us
(Paused)ScanGrayZygoteSpaceObjects:        Sum: 134us 99% C.I. 33us-34us Avg: 33.500us Max: 34us
MarkingPhase:        Sum: 131us 99% C.I. 10us-18us Avg: 11.909us Max: 18us
(Paused)PausePhase:        Sum: 121us 99% C.I. 7us-20us Avg: 11us Max: 20us
ProcessCards:        Sum: 115us 99% C.I. 3us-11us Avg: 5.227us Max: 11us
PreCleanCards:        Sum: 112us 99% C.I. 8us-15us Avg: 10.181us Max: 15us
RevokeAllThreadLocalAllocationStacks:        Sum: 96us 99% C.I. 5us-14us Avg: 8.727us Max: 14us
ReclaimPhase:        Sum: 69us 99% C.I. 5us-9us Avg: 6.272us Max: 9us
ProcessReferences:        Sum: 64us 99% C.I. 3us-18us Avg: 5.818us Max: 18us
InitializePhase:        Sum: 54us 99% C.I. 1us-13us Avg: 4.909us Max: 13us
Sweep:        Sum: 53us 99% C.I. 3us-9us Avg: 4.818us Max: 9us
MarkRoots:        Sum: 41us 99% C.I. 3us-5us Avg: 3.727us Max: 5us
RecursiveMark:        Sum: 32us 99% C.I. 2us-4us Avg: 2.909us Max: 4us
BindBitmaps:        Sum: 25us 99% C.I. 1us-4us Avg: 2.272us Max: 4us
SwapStacks:        Sum: 12us 99% C.I. 1us-2us Avg: 1.090us Max: 2us
SweepLargeObjects:        Sum: 10us 99% C.I. 250ns-1000ns Avg: 909ns Max: 1000ns
(Paused)ProcessMarkStack:        Sum: 2us 99% C.I. 250ns-1000ns Avg: 181ns Max: 1000ns
PreSweepingGcVerification:        Sum: 1us 99% C.I. 250ns-1000ns Avg: 90ns Max: 1000ns
FindDefaultSpaceBitmap:        Sum: 0 99% C.I. 0ns-0ns Avg: 0ns Max: 0ns
Done Dumping histograms 
concurrent mark sweep paused:        Sum: 3.508ms 99% C.I. 202us-895us Avg: 318.909us Max: 895us
concurrent mark sweep total time: 196.195ms mean time: 17.835ms
concurrent mark sweep freed: 37401 objects with total size 2029KB
concurrent mark sweep throughput: 190821/s / 10MB/s
Start Dumping histograms for 7 iterations for partial concurrent mark sweep
ProcessMarkStack:        Sum: 261.605ms 99% C.I. 0.007ms-52.128ms Avg: 12.457ms Max: 52.686ms
UpdateAndMarkImageModUnionTable:        Sum: 39.172ms 99% C.I. 2.672ms-9.112ms Avg: 5.596ms Max: 9.112ms
SweepMallocSpace:        Sum: 33.740ms 99% C.I. 0.009ms-23.743ms Avg: 2.410ms Max: 25.130ms
MarkRootsCheckpoint:        Sum: 24.023ms 99% C.I. 0.270ms-6.932ms Avg: 1.715ms Max: 7.087ms
ScanGrayAllocSpaceObjects:        Sum: 17.785ms 99% C.I. 0.014ms-7.313ms Avg: 1.270ms Max: 7.540ms
MarkConcurrentRoots:        Sum: 11.788ms 99% C.I. 4us-2425.500us Avg: 842us Max: 2441us
(Paused)ScanGrayObjects:        Sum: 7.835ms 99% C.I. 0.328ms-2.585ms Avg: 1.119ms Max: 2.585ms
ReMarkRoots:        Sum: 5.637ms 99% C.I. 218us-2109.750us Avg: 805.285us Max: 2131us
SweepLargeObjects:        Sum: 2.383ms 99% C.I. 161us-905us Avg: 340.428us Max: 905us
ScanGrayImageSpaceObjects:        Sum: 2.340ms 99% C.I. 95us-1505us Avg: 334.285us Max: 1505us
UpdateAndMarkZygoteModUnionTable:        Sum: 2.092ms 99% C.I. 248us-340us Avg: 298.857us Max: 340us
ImageModUnionClearCards:        Sum: 2.053ms 99% C.I. 81us-890.500us Avg: 146.642us Max: 931us
AllocSpaceClearCards:        Sum: 1.524ms 99% C.I. 2us-162us Avg: 54.428us Max: 162us
EnqueueFinalizerReferences:        Sum: 1.082ms 99% C.I. 9us-494.750us Avg: 154.571us Max: 495us
MarkNonThreadRoots:        Sum: 798us 99% C.I. 27us-106us Avg: 57us Max: 106us
SweepSystemWeaks:        Sum: 717us 99% C.I. 25us-251us Avg: 102.428us Max: 251us
MarkAllocStackAsLive:        Sum: 640us 99% C.I. 26us-227us Avg: 91.428us Max: 227us
FinishPhase:        Sum: 593us 99% C.I. 58us-126us Avg: 84.714us Max: 126us
ZygoteModUnionClearCards:        Sum: 448us 99% C.I. 28us-42us Avg: 32us Max: 42us
RevokeAllThreadLocalAllocationStacks:        Sum: 269us 99% C.I. 23us-60us Avg: 38.428us Max: 60us
ScanGrayZygoteSpaceObjects:        Sum: 245us 99% C.I. 32us-42us Avg: 35us Max: 42us
MarkRoots:        Sum: 241us 99% C.I. 4us-211us Avg: 34.428us Max: 211us
PreCleanCards:        Sum: 169us 99% C.I. 10us-89us Avg: 24.142us Max: 89us
ProcessReferences:        Sum: 159us 99% C.I. 8us-39us Avg: 22.714us Max: 39us
MarkingPhase:        Sum: 116us 99% C.I. 14us-19us Avg: 16.571us Max: 19us
SwapBitmaps:        Sum: 94us 99% C.I. 11us-15us Avg: 13.428us Max: 15us
(Paused)PausePhase:        Sum: 84us 99% C.I. 8us-14us Avg: 12us Max: 14us
ProcessCards:        Sum: 82us 99% C.I. 4us-8us Avg: 5.857us Max: 8us
ReclaimPhase:        Sum: 55us 99% C.I. 6us-12us Avg: 7.857us Max: 12us
Sweep:        Sum: 53us 99% C.I. 6us-10us Avg: 7.571us Max: 10us
RecursiveMark:        Sum: 40us 99% C.I. 2us-25us Avg: 5.714us Max: 25us
BindBitmaps:        Sum: 16us 99% C.I. 1us-4us Avg: 2.285us Max: 4us
InitializePhase:        Sum: 11us 99% C.I. 1us-3us Avg: 1.571us Max: 3us
UnBindBitmaps:        Sum: 8us 99% C.I. 1us-2us Avg: 1.142us Max: 2us
SweepZygoteSpace:        Sum: 7us 99% C.I. 1us-1us Avg: 1us Max: 1us
(Paused)ProcessMarkStack:        Sum: 6us 99% C.I. 250ns-1000ns Avg: 857ns Max: 1000ns
FindDefaultSpaceBitmap:        Sum: 1us 99% C.I. 250ns-1000ns Avg: 142ns Max: 1000ns
PreSweepingGcVerification:        Sum: 0 99% C.I. 0ns-0ns Avg: 0ns Max: 0ns
Done Dumping histograms 
partial concurrent mark sweep paused:        Sum: 14.159ms 99% C.I. 0.943ms-4.590ms Avg: 2.022ms Max: 4.590ms
partial concurrent mark sweep total time: 417.922ms mean time: 59.703ms
partial concurrent mark sweep freed: 87577 objects with total size 9MB
partial concurrent mark sweep throughput: 210017/s / 23MB/s
Start Dumping histograms for 45 iterations for sticky concurrent mark sweep
ScanGrayAllocSpaceObjects:        Sum: 474.167ms 99% C.I. 0.005ms-31.119ms Avg: 2.634ms Max: 44.113ms
MarkRootsCheckpoint:        Sum: 303.764ms 99% C.I. 0.121ms-65.199ms Avg: 3.375ms Max: 82.807ms
FreeList:        Sum: 155.352ms 99% C.I. 3us-5197.999us Avg: 211.651us Max: 16415us
ScanGrayImageSpaceObjects:        Sum: 103.966ms 99% C.I. 0.089ms-11.839ms Avg: 1.155ms Max: 12.023ms
MarkConcurrentRoots:        Sum: 86.345ms 99% C.I. 3us-7884.999us Avg: 959.388us Max: 9039us
ProcessMarkStack:        Sum: 72.256ms 99% C.I. 1.210us-8796us Avg: 405.932us Max: 11943us
ReMarkRoots:        Sum: 54.893ms 99% C.I. 0.047ms-7.832ms Avg: 1.219ms Max: 7.888ms
SweepArray:        Sum: 50.684ms 99% C.I. 0.072ms-5.475ms Avg: 1.126ms Max: 5.690ms
(Paused)ScanGrayObjects:        Sum: 44.636ms 99% C.I. 0.257ms-6.706ms Avg: 1.038ms Max: 6.837ms
AllocSpaceClearCards:        Sum: 20.095ms 99% C.I. 2us-1074.999us Avg: 111.638us Max: 3549us
MarkingPhase:        Sum: 10.223ms 99% C.I. 188us-370us Avg: 227.177us Max: 370us
ImageModUnionClearCards:        Sum: 8.928ms 99% C.I. 77us-354.999us Avg: 99.200us Max: 376us
SweepSystemWeaks:        Sum: 8.232ms 99% C.I. 18us-2006.250us Avg: 182.933us Max: 2356us
MarkNonThreadRoots:        Sum: 5.437ms 99% C.I. 17us-254.999us Avg: 60.411us Max: 296us
RevokeAllThreadLocalAllocationStacks:        Sum: 5.147ms 99% C.I. 7us-2176.250us Avg: 114.377us Max: 2715us
ScanGrayZygoteSpaceObjects:        Sum: 3.604ms 99% C.I. 32us-140us Avg: 41.906us Max: 140us
ZygoteModUnionClearCards:        Sum: 3.034ms 99% C.I. 27us-157us Avg: 35.279us Max: 169us
EnqueueFinalizerReferences:        Sum: 2.413ms 99% C.I. 3us-372us Avg: 53.622us Max: 372us
(Paused)ScanGrayImageSpaceObjects:        Sum: 1.899ms 99% C.I. 182us-1717us Avg: 949.500us Max: 1717us
FinishPhase:        Sum: 1.806ms 99% C.I. 22us-66us Avg: 40.133us Max: 66us
ResetStack:        Sum: 1.720ms 99% C.I. 16us-138.750us Avg: 38.222us Max: 141us
ProcessCards:        Sum: 1.162ms 99% C.I. 4us-324.999us Avg: 12.911us Max: 535us
PreCleanCards:        Sum: 827us 99% C.I. 8us-205us Avg: 18.377us Max: 227us
(Paused)PausePhase:        Sum: 568us 99% C.I. 7us-28us Avg: 12.622us Max: 28us
ReclaimPhase:        Sum: 366us 99% C.I. 6us-34us Avg: 8.133us Max: 34us
ProcessReferences:        Sum: 318us 99% C.I. 3us-28us Avg: 7.066us Max: 28us
SwapBitmaps:        Sum: 283us 99% C.I. 5us-12us Avg: 6.288us Max: 12us
MarkRoots:        Sum: 208us 99% C.I. 3us-14us Avg: 4.622us Max: 14us
BindBitmaps:        Sum: 195us 99% C.I. 1us-88.750us Avg: 4.333us Max: 94us
RecordFree:        Sum: 111us 99% C.I. 1us-57us Avg: 2.466us Max: 57us
UnBindBitmaps:        Sum: 110us 99% C.I. 1us-17us Avg: 2.444us Max: 17us
InitializePhase:        Sum: 96us 99% C.I. 1us-10us Avg: 2.133us Max: 10us
(Paused)ScanGrayAllocSpaceObjects:        Sum: 82us 99% C.I. 1us-44us Avg: 20.500us Max: 44us
SwapStacks:        Sum: 73us 99% C.I. 1us-3us Avg: 1.622us Max: 3us
(Paused)ProcessMarkStack:        Sum: 58us 99% C.I. 0.250us-12us Avg: 1.288us Max: 12us
ForwardSoftReferences:        Sum: 51us 99% C.I. 1us-3us Avg: 1.186us Max: 3us
FindDefaultSpaceBitmap:        Sum: 49us 99% C.I. 0.250us-3us Avg: 1.088us Max: 3us
PreSweepingGcVerification:        Sum: 4us 99% C.I. 250ns-1000ns Avg: 88ns Max: 1000ns
Done Dumping histograms 
sticky concurrent mark sweep paused:        Sum: 124.287ms 99% C.I. 0.304ms-11.662ms Avg: 2.761ms Max: 11.880ms
sticky concurrent mark sweep total time: 1.423s mean time: 31.625ms
sticky concurrent mark sweep freed: 700436 objects with total size 38MB
sticky concurrent mark sweep throughput: 492225/s / 26MB/s
Total time spent in GC: 2.037s
Mean GC size throughput: 22MB/s
Mean GC object throughput: 428302 objects/s
Total number of allocations 1117995
Total bytes allocated 69MB
Free memory 288KB
Free memory until GC 288KB
Free memory until OOME 232MB
Total memory 23MB
Max memory 256MB
Total mutator paused time: 141.954ms
Total time waiting for GC to complete: 10.373ms

DALVIK THREADS (62):
"main" prio=5 tid=1 Native
  | group="main" sCount=1 dsCount=0 obj=0x735bce70 self=0xf4827400
  | sysTid=2344 nice=0 cgrp=default sched=0/0 handle=0xf755dbec
  | state=S schedstat=( 5284226033 2189387546 17012 ) utm=444 stm=84 core=3 HZ=100
  | stack=0xff483000-0xff485000 stackSize=8MB
  | held mutexes=
  kernel: __switch_to+0x8c/0x98
  kernel: SyS_epoll_wait+0x304/0x44c
  kernel: compat_SyS_epoll_pwait+0x11c/0x128
  kernel: cpu_switch_to+0x48/0x4c
  native: #00 pc 0003b1e0  /system/lib/libc.so (__epoll_pwait+20)
  native: #01 pc 00015213  /system/lib/libc.so (epoll_pwait+26)
  native: #02 pc 00015221  /system/lib/libc.so (epoll_wait+6)
  native: #03 pc 000127fb  /system/lib/libutils.so (android::Looper::pollInner(int)+98)
  native: #04 pc 00012a29  /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+92)
  native: #05 pc 000858ed  /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22)
  native: #06 pc 000b4f6b  /data/dalvik-cache/arm/system@framework@boot.oat (Java_android_os_MessageQueue_nativePollOnce__JI+102)
  at android.os.MessageQueue.nativePollOnce(Native method)
  at android.os.MessageQueue.next(MessageQueue.java:148)
  at android.os.Looper.loop(Looper.java:151)
  at android.app.ActivityThread.main(ActivityThread.java:5650)
  at java.lang.reflect.Method.invoke!(Native method)
  at java.lang.reflect.Method.invoke(Method.java:372)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
  
  "AsyncTask #1" prio=5 tid=39 Waiting
  | group="main" sCount=1 dsCount=0 obj=0x1351c280 self=0xf4bc4000
  | sysTid=2797 nice=10 cgrp=bg_non_interactive sched=0/0 handle=0xe0bf1000
  | state=S schedstat=( 990359192 4076806009 17356 ) utm=65 stm=34 core=1 HZ=100
  | stack=0xdeef4000-0xdeef6000 stackSize=1036KB
  | held mutexes=
  at java.lang.Object.wait!(Native method)
  - waiting on <0x08a7c4b6> (a java.lang.Object)
  at java.lang.Thread.parkFor(Thread.java:1220)
  - locked <0x08a7c4b6> (a java.lang.Object)
  at sun.misc.Unsafe.park(Unsafe.java:299)
  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2016)
  at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:410)
  at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
  at java.lang.Thread.run(Thread.java:818)

Heap部分

Heap: 3% free, 22MB/23MB; 243971 objects

在JVM中,堆(Heap)是用于存储所有对象实例的主要内存区域。‘Heap: 3% free, 22MB/23MB; 243971 objects’ 这行信息通常是由Java的垃圾收集器(Garbage Collector)输出的,用于描述堆内存的使用情况。

  • ‘3% free’ 表示堆内存中只有3%的空间是空闲的。
  • ‘22MB/23MB’ 表示当前堆内存已使用22MB,总大小为23MB。
  • ‘243971 objects’ 表示当前堆内存中有243971个对象实例。
    当堆内存中的空闲空间不足时,JVM会尝试进行垃圾收集,以回收不再使用的对象占用的内存。如果垃圾收集后仍然没有足够的空间,那么JVM会尝试扩大堆的大小,或者报告内存溢出错误(OutOfMemoryError),这取决于JVM的配置和垃圾收集器的策略。

垃圾回收器输出的histograms 部分

Done Dumping histograms 
sticky concurrent mark sweep paused:        Sum: 5.399ms 99% C.I. 1.436ms-2.103ms Avg: 1.799ms Max: 2.103ms
sticky concurrent mark sweep total time: 89.691ms mean time: 29.897ms
sticky concurrent mark sweep freed: 198493 objects with total size 7MB
sticky concurrent mark sweep throughput: 2.23026e+06/s / 80MB/s
Total time spent in GC: 181.554ms
Mean GC size throughput: 303MB/s
Mean GC object throughput: 6.09857e+06 objects/s
Total number of allocations 1351190
Total bytes allocated 77MB
Free memory 748KB
Free memory until GC 748KB
Free memory until OOME 233MB
Total memory 23MB
Max memory 256MB
Total mutator paused time: 7.310ms
Total time waiting for GC to complete: 10.382ms

这段日志来自于Android的垃圾收集器(Garbage Collector),具体地,是Concurrent Mark Sweep(CMS)垃圾收集器的日志。CMS是一种使用标记-清除算法的垃圾收集器,它在Java和Android中被广泛使用。
解释如下:

  • ‘Done Dumping histograms’:直方图的数据已经导出完成。
  • ‘sticky concurrent mark sweep paused’:CMS标记阶段暂停的时间,包括总时间、99%的置信区间、平均值、最大值。
  • ‘sticky concurrent mark sweep total time’:CMS标记阶段总时间,包括平均时间。
  • ‘sticky concurrent mark sweep freed’:CMS标记阶段释放的对象数量和总大小。
  • ‘sticky concurrent mark sweep throughput’:CMS标记阶段的吞吐量,包括对象吞吐量和字节吞吐量。
  • ‘Total time spent in GC’:在垃圾收集上花费的总时间。
  • ‘Mean GC size throughput’:平均每次GC的字节吞吐量。
  • ‘Mean GC object throughput’:平均每次GC的对象吞吐量。
  • ‘Total number of allocations’:分配的总对象数量。
  • ‘Total bytes allocated’:分配的总字节数。
  • ‘Free memory’:当前空闲内存。
  • ‘Free memory until GC’:GC前的空闲内存。
  • ‘Free memory until OOME’:OutOfMemoryError前的空闲内存。
  • ‘Total memory’:总内存。
  • ‘Max memory’:最大内存。
  • ‘Total mutator paused time’:应用程序暂停的总时间。
  • ‘Total time waiting for GC to complete’:等待GC完成的总时间。

Thread部分

"main" prio=5 tid=1 Native
"FinalizerDaemon" daemon prio=5 tid=7 Waiting
"ARouter task pool No.1, thread No.1" prio=5 tid=16 Waiting
"ARouter task pool No.1, thread No.2" prio=5 tid=17 Waiting

线程状态有5种:新建、就绪、执行、阻塞、死亡。而Java中的线程状态有6种,6种状态都定义在:java.lang.Thread.State中在这里插入图片描述
main线程的native是什么状态,哪来的?其实trace文件中的状态是是CPP代码中定义的状态,下面是一张对应关系表。在这里插入图片描述
main函数的native状态是正在执行JNI函数。堆栈信息是我们分析ANR的第一个重要的信息,一般来说:

  1. main线程处于 BLOCK、WAITING、TIMEWAITING状态,那基本上是函数阻塞导致ANR;
  2. 如果main线程无异常,则应该排查CPU负载和内存环境。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1711240.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

SpringSecurity6从入门到实战之引言和基本概念

SpringSecurity6从入门到实战之引言和基本概念 前言 在当今数字化时代&#xff0c;随着网络应用的日益普及&#xff0c;保护用户数据和系统安全变得至关重要。作为Java开发社区的中坚力量&#xff0c;Spring框架提供了一整套解决方案来构建企业级应用程序。然而&#xff0c;随…

Android 13 VSYNC重学习

Android 13 VSYNC重学习 引言 学无止境&#xff0c;一个字干就完事&#xff01; 源码参考基于Android 13 aosp&#xff01; 一. Android VSync模块开胃菜 在开始正式的分析之前&#xff0c;我们先简单对Android的Vsync模块简单介绍下,如下图所示&#xff0c;其中: HW_VSync是…

Dolphinscheduler不重启加载Oracle驱动

转载自刘茫茫看山 问题背景 某天我们的租户反馈数据库连接缺少必要的驱动&#xff0c;我们通过日志查看确实是缺少部分数据库的驱动&#xff0c;因为DolphinScheduler默认只带了Oracle和MySQL的驱动&#xff0c;并且需要将pom文件中的test模式去掉才可以在打包的时候引入。我…

C# 中 async 与 await 关键字详解

async 和 await 关键字的作用是使方法能够异步执行并等待异步操作的完成。&#xff08;最重要的一点是记住 “异步执行”与“等待异步操作完成”&#xff0c;不是等待主线程操作完成&#xff09; async 修饰符可将 方法、lambda 表达式或匿名方法指定为异步。 async 关键字用于…

一张图一个表——CSS选择器总结

CSS选择器总结&#xff1a; (这些表是一张图片^_^) 看底部 完整思维导图图片和表格的下载地址&#xff1a;https://download.csdn.net/download/denlnyyr/10597820

LeetCode 377.组合总和Ⅳ

这题是我蠢了&#xff0c;它说是组合数我就信了&#xff0c;言尽于此 class Solution { public:int combinationSum4(vector<int>& nums, int target) {vector<int> dp(2000,0);dp[0]1;for(int i0;i<target;i){for(int j0;j<nums.size();j){if(i>nums…

22.Volatile原理

文章目录 Volatile原理1.Volatile语义中的内存屏障1.1.volatile写操作的内存屏障1.1.1.StoreStore 屏障1.1.2.StoreLoad 屏障 1.2.volatile读操作的内存屏障1.2.1.LoadStore屏障1.2.2.LoadLoad屏障 2.volatile不具备原子性2.1.原理 Volatile原理 1.Volatile语义中的内存屏障 在…

定位器与PWM的LED控制

文章目录 一、STM32定时器二、脉宽调制pwm三、定时器控制led&#xff08;1&#xff09;实验内容&#xff08;2&#xff09;创建工程&#xff08;3&#xff09;Keli程序&#xff08;4&#xff09;观察波形图&#xff08;5&#xff09;实物连接图&#xff08;6&#xff09;实践效…

Python机器学习 Tensorflow + keras 实现CNN

一、实验目的 1. 了解SkLearn Tensorlow使用方法 2. 了解SkLearn keras使用方法 二、实验工具&#xff1a; 1. SkLearn 三、实验内容 &#xff08;贴上源码及结果&#xff09; 使用Tensorflow对半环形数据集分 #encoding:utf-8import numpy as npfrom sklearn.datasets i…

AI图书推荐:用ChatGPT和Python搭建AI应用来变现

《用ChatGPT和Python搭建AI应用来变现》&#xff08;Building AI Applications with ChatGPT API&#xff09;将ChatGPT API与Python结合使用&#xff0c;可以开启构建非凡AI应用的大门。通过利用这些API&#xff0c;你可以专注于应用逻辑和用户体验&#xff0c;而ChatGPT强大的…

clocking wizard IP核通过AXI4-Lite接口实现动态重新配置应用实例

在最近的FPGA应用中&#xff0c;应用到了基于Zynq 7000的Uart串口设计&#xff0c;为了让串口的时钟更精确&#xff0c;采用了外部时钟模式&#xff0c;如下图所示。外部时钟连接到了Clocking Wizard IP核的输出端。 在串口通信时&#xff0c;发现串口有错码出现。例如&#xf…

ADS基础教程16 - 存档和导入(workspace、cell、view)

设计加密保护IP 一、引言二、workspace归档二、Cell归档三、View归档四、导入归档文件 一、引言 介绍如何ADS中如何对workspace、cell和view进行存档&#xff0c;以及如何将存档文件导入到工程中。 二、workspace归档 (1)在菜单栏中&#xff0c;选择File–>Archive Works…

Follow Your Pose: Pose-Guided Text-to-Video Generation using Pose-Free Videos

清华深&港科&深先进&Tencent AAAI24https://github.com/mayuelala/FollowYourPose 问题引入 本文的任务是根据文本来生成高质量的角色视频&#xff0c;并且可以通过pose来控制任务的姿势&#xff1b;当前缺少video-pose caption数据集&#xff0c;所以提出一个两…

Chisel入门——在windows下vscode搭建|部署Scala2.13.3开发环境|用Chisel点亮FPGA小灯

文章目录 前言一、vscode搭建scala开发环境1.1 安装Scala官方插件Scala Syntax1.2 创建hello_world.scala文件1.3 确认java的版本(博主使用的是1.8)1.4 下载Scala Windows版本的二进制文件1.5 配置环境变量1.6 交互模式测试一下1.7 vscode运行scala 二、windows安装sbt2.1 下载…

Matlab|主动配电网故障恢复与孤岛划分模型【多时段】

目录 1 主要内容 1.1 模型目标 1.2 约束条件 2 部分代码 3 程序结果 4 下载链接 1 主要内容 程序主要方法复现《主动配电网故障恢复的重构与孤岛划分统一模型》&#xff0c;完全复现检修策略约束和潮流约束&#xff0c;辐射状与连通性约束考虑孤岛划分情形&#xff0c;采…

翻译《Use FILE_SHARE_DELETE in your shell extension》

在写 《翻译《The Old New Thing》- What did MakeProcInstance do?》 文章时&#xff0c;了解到了 Michael Geary &#xff0c;他也有不少优秀的技术文章&#xff0c;现翻译一篇关于文件操作的细节的文章 原文 Use FILE_SHARE_DELETE in your shell extension | mg.tohttps:…

【Unity之FGUI】白仙章Fairy GUI控件详解二

&#x1f468;‍&#x1f4bb;个人主页&#xff1a;元宇宙-秩沅 &#x1f468;‍&#x1f4bb; hallo 欢迎 点赞&#x1f44d; 收藏⭐ 留言&#x1f4dd; 加关注✅! &#x1f468;‍&#x1f4bb; 本文由 秩沅 原创 &#x1f468;‍&#x1f4bb; 收录于专栏&#xff1a;就业…

硬盘监控,保障硬盘性能

硬盘驱动器是个人计算机和服务器中用于存储数字数据的硬件部件&#xff0c;硬盘突然故障可能导致永久数据丢失&#xff0c;大多数硬盘驱动器使用自我监控、分析和报告技术&#xff08;SMART&#xff09;来跟踪各种性能指标并分析其自身的运行状况。然而&#xff0c;并不是所有的…

HackTheBox-Machines--Popcorn

文章目录 0x01 端口扫描0x02 测试思路2.1 80端口测试 0x03 /torrent 目录文件上传测试0x04 权限提升 Popcorn 测试过程 0x01 端口扫描 (base) gryphonwsdl ~ %nmap -sC -sV 10.129.138.22 Starting Nmap 7.94 ( https://nmap.org ) at 2024-05-28 14:22 CST Nmap scan report …

Linux shell编程学习笔记51: cat /proc/cpuinfo:查看CPU详细信息

0 前言 2024年的网络安全检查又开始了&#xff0c;对于使用基于Linux的国产电脑&#xff0c;我们可以编写一个脚本来收集系统的有关信息。对于中央处理器CPU比如&#xff0c;我们可以使用cat /proc/cpuinfo命令来收集中央处理器CPU的信息。 1. /proc/cpuinfo 保存了系统的cpu…