@
Licsber 我在 mac 上测试的, 好像是因为 thread 没有退出.
Sampling process 19768 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling ___go_build_add_go (pid 19768) every 1 millisecond
Process: ___go_build_add_go [19768]
Path: /private/var/folders/wd/vt73dmmj5y38hft8kg5l1wgm0000gq/T/___go_build_add_go
Load Address: 0x1000000
Identifier: ___go_build_add_go
Version: ???
Code Type: X86-64
Parent Process: goland [14064]
Date/Time: 2018-12-06 21:33:47.174 +0800
Launch Time: 2018-12-06 21:33:00.224 +0800
OS Version: Mac OS X 10.13.6 (17G3025)
Report Version: 7
Analysis Tool: /usr/bin/sample
Physical footprint: 1.2G
Physical footprint (peak): 1.2G
----
Call graph:
2580 Thread_15197711 DispatchQueue_1: com.apple.main-thread (serial)
+ 2580 runtime.asmcgocall (in ___go_build_add_go) + 112 [0x1050da0]
+ 2580 runtime.pthread_cond_timedwait_relative_np_trampoline (in ___go_build_add_go) + 20 [0x1053204]
+ 2580 _pthread_cond_wait (in libsystem_pthread.dylib) + 789 [0x7fff5779a5c2]
+ 2580 __psynch_cvwait (in libsystem_kernel.dylib) + 10 [0x7fff575d1a16]
2580 Thread_15197713
+ 2580 thread_start (in libsystem_pthread.dylib) + 13 [0x7fff57798bf9]
+ 2580 _pthread_start (in libsystem_pthread.dylib) + 377 [0x7fff5779950d]
+ 2580 runtime.mstart_stub (in ___go_build_add_go) + 46 [0x10530ce]
+ 2580 runtime.mstart (in ___go_build_add_go) + 102 [0x102b9d6]
+ 2580 runtime.mstart1 (in ___go_build_add_go) + 230 [0x102bad6]
+ 2580 runtime.sysmon (in ___go_build_add_go) + 371 [0x10330b3]
+ 2580 runtime.notetsleep (in ___go_build_add_go) + 105 [0x1009499]
+ 2580 runtime.notetsleep_internal (in ___go_build_add_go) + 269 [0x10092cd]
+ 2580 runtime.semasleep (in ___go_build_add_go) + 271 [0x1024e3f]
+ 2580 runtime.pthread_cond_timedwait_relative_np (in ___go_build_add_go) + 81 [0x1043301]
+ 2580 runtime.asmcgocall (in ___go_build_add_go) + 173 [0x1050ddd]
+ 2580 runtime.pthread_cond_timedwait_relative_np_trampoline (in ___go_build_add_go) + 20 [0x1053204]
+ 2580 _pthread_cond_wait (in libsystem_pthread.dylib) + 789 [0x7fff5779a5c2]
+ 2580 __psynch_cvwait (in libsystem_kernel.dylib) + 10 [0x7fff575d1a16]
2580 Thread_15197714
+ 2580 runtime.mcall (in ___go_build_add_go) + 91 [0x104f52b]
+ 2580 runtime.goexit0 (in ___go_build_add_go) + 498 [0x102f552]
+ 2580 runtime.schedule (in ___go_build_add_go) + 314 [0x102eb6a]
+ 2580 runtime.findrunnable (in ___go_build_add_go) + 1244 [0x102e05c]
+ 2580 runtime.stopm (in ___go_build_add_go) + 227 [0x102cee3]
+ 2580 runtime.notesleep (in ___go_build_add_go) + 227 [0x1009163]
+ 2580 runtime.semasleep (in ___go_build_add_go) + 133 [0x1024db5]
+ 2580 runtime.pthread_cond_wait (in ___go_build_add_go) + 81 [0x1043291]
+ 2580 runtime.asmcgocall (in ___go_build_add_go) + 173 [0x1050ddd]
+ 2580 runtime.pthread_cond_wait_trampoline (in ___go_build_add_go) + 16 [0x10531e0]
+ 2580 _pthread_cond_wait (in libsystem_pthread.dylib) + 732 [0x7fff5779a589]
+ 2580 __psynch_cvwait (in libsystem_kernel.dylib) + 10 [0x7fff575d1a16]
.... 一共重复了 10 个 thread. 我在研究一下