time: 2024/12/20 23:41:08 pid: 55855 vss: 57201248 rss: 478548 process: com.hx.example summary: 703 Top 10 Thread Name: 621 com.hx.example 9 ThreadPoolForeg 8 OS_FFRT_3_2 6 ThreadPoolSingl 5 OS_GC_Thread 3 gpu-work-client 2 OS_NET_HttpWork
Tid:2478, Name:com.hx.example #00 pc 00000000001b6510 /system/lib/ld-musl-aarch64.so.1(__timedwait_cp+192)(fbb1eb526bb54f59c5dc4f2521b68e52) #01 pc 00000000001b8514 /system/lib/ld-musl-aarch64.so.1(__pthread_cond_timedwait+188)(fbb1eb526bb54f59c5dc4f2521b68e52) #02 pc 00000000000c1124 /system/lib64/libc++.so(std::__h::condition_variable::wait(std::__h::unique_lock<std::__h::mutex>&)+20)(dfedb06268d7f896c86362ced8e6c5c77e36a0da) #03 pc 00000000000e6980 /system/lib64/module/hms/officeservice/libpdfservice.z.so(void* std::__h::__thread_proxy[abi:v15004]<std::__h::tuple<std::__h::unique_ptr<std::__h::__thread_struct, std::__h::default_delete<std::__h::__thread_struct>>, DocumentBaseST::DocumentBaseST(IPDF_Document*)::$_0>>(void*)+324)(d02bcdfd65731d541761e17057ebf133) #04 pc 00000000001bac20 /system/lib/ld-musl-aarch64.so.1(start+236)(fbb1eb526bb54f59c5dc4f2521b68e52) Tid:3591, Name:com.hx.example #00 pc 00000000001b6510 /system/lib/ld-musl-aarch64.so.1(__timedwait_cp+192)(fbb1eb526bb54f59c5dc4f2521b68e52) #01 pc 00000000001b8514 /system/lib/ld-musl-aarch64.so.1(__pthread_cond_timedwait+188)(fbb1eb526bb54f59c5dc4f2521b68e52) #02 pc 00000000000c1124 /system/lib64/libc++.so(std::__h::condition_variable::wait(std::__h::unique_lock<std::__h::mutex>&)+20)(dfedb06268d7f896c86362ced8e6c5c77e36a0da) #03 pc 00000000000951ac /system/lib64/module/hms/officeservice/libpdfservice.z.so(void std::__h::condition_variable_any::wait<std::__h::unique_lock<std::__h::mutex>>(std::__h::unique_lock<std::__h::mutex>&)+108)(d02bcdfd65731d541761e17057ebf133) #04 pc 0000000000092dd8 /system/lib64/module/hms/officeservice/libpdfservice.z.so(coro::thread_pool::executor(unsigned long)+156)(d02bcdfd65731d541761e17057ebf133) #05 pc 0000000000094d2c /system/lib64/module/hms/officeservice/libpdfservice.z.so(void* std::__h::__thread_proxy[abi:v15004]<std::__h::tuple<std::__h::unique_ptr<std::__h::__thread_struct, std::__h::default_delete<std::__h::__thread_struct>>, coro::thread_pool::thread_pool(coro::thread_pool::options)::$_0>>(void*)+68)(d02bcdfd65731d541761e17057ebf133) #06 pc 00000000001bac20 /system/lib/ld-musl-aarch64.so.1(start+236)(fbb1eb526bb54f59c5dc4f2521b68e52) Tid:2478, Name:com.hx.example #00 pc 00000000001b6510 /system/lib/ld-musl-aarch64.so.1(__timedwait_cp+192)(fbb1eb526bb54f59c5dc4f2521b68e52) #01 pc 00000000001b8514 /system/lib/ld-musl-aarch64.so.1(__pthread_cond_timedwait+188)(fbb1eb526bb54f59c5dc4f2521b68e52) #02 pc 00000000000c1124 /system/lib64/libc++.so(std::__h::condition_variable::wait(std::__h::unique_lock<std::__h::mutex>&)+20)(dfedb06268d7f896c86362ced8e6c5c77e36a0da) #03 pc 00000000000e6980 /system/lib64/module/hms/officeservice/libpdfservice.z.so(void* std::__h::__thread_proxy[abi:v15004]<std::__h::tuple<std::__h::unique_ptr<std::__h::__thread_struct, std::__h::default_delete<std::__h::__thread_struct>>, DocumentBaseST::DocumentBaseST(IPDF_Document*)::$_0>>(void*)+324)(d02bcdfd65731d541761e17057ebf133) #04 pc 00000000001bac20 /system/lib/ld-musl-aarch64.so.1(start+236)(fbb1eb526bb54f59c5dc4f2521b68e52)
降低线程池大小,避免大量线程同时存在,更多参考线程泄漏问题优化建议。
确保锁得到正确的管理,在异常分支提前返回时释放互斥锁。更多参考优化建议1:多线程操作锁时,需要合理使用lock_guard这类自动控制持锁和释放锁的管理方式。