我们使用 Ractjs 3、JavaScriptEngineSwitcher 和 Microsoft.ChakraCore 开发了我们的代码。
有时,我的应用程序需要几秒钟来加载页面,但我的应用程序日志中没有任何错误,因此我决定使用 Windows 服务器上的 DebugDiag 工具对其进行诊断。然后我发现了几个与 Chakra 相关的 ThreadAbortException。
System.Threading.ThreadAbortException
威胁已经被清除了
System.Threading.WaitHandle.WaitOneNative(System.Runtime.InteropServices.SafeHandle, UInt32, Boolean, Boolean) System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle, Int64, Boolean, Boolean) System.Threading.WaitHandle。 WaitOne(Int32, Boolean) JavaScriptEngineSwitcher.ChakraCore.ScriptDispatcher.StartThread() System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) System.Threading.ExecutionContext.Run(System .Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) System.Threading.ThreadHelper.ThreadStart()
20% 的线程有:。
入口点 ChakraCore!JsDisposeRuntime+12a44
调用堆栈
ntdll!NtWaitForMultipleObjects+14
KERNELBASE!WaitForMultipleObjectsEx+ef
脉轮核心+bd824
ChakraCore!JsDisposeRuntime+26ee
ChakraCore!JsDisposeRuntime+12aa1
kernel32!BaseThreadInitThunk+14
ntdll!RtlUserThreadStart+21
还有另外 20% 有:
入口点 ChakraCore!JsDisposeRuntime+12a44
调用堆栈
ntdll!NtWaitForMultipleObjects+14
KERNELBASE!WaitForMultipleObjectsEx+ef
ChakraCore!JsGetPropertyIdFromName+1673
ChakraCore!JsGetPropertyIdFromName+1410
ChakraCore!JsGetPropertyIdFromName+993
ChakraCore!JsDisposeRuntime+12aa1
kernel32!BaseThreadInitThunk+14
ntdll!RtlUserThreadStart+21