任务数量是否有限制?

use*_*719 5 c# task windows-runtime

我正在运行一个包含多个任务的winrt程序.在运行过程中,我得到以下异常:

Not enough quota is available to process this command
Run Code Online (Sandbox Code Playgroud)

堆栈跟踪是

   at Windows.UI.Core.CoreDispatcher.InvokeAsync(CoreDispatcherPriority priority, InvokedHandler freeThreadedCallback, Object sender, Object context)
   at System.Threading.WinRTSynchronizationContext.Post(SendOrPostCallback d, Object state)
   at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.InvokeOrPostAction(Object state)
   at System.Threading.Tasks.AwaitTaskContinuation.RunInline(ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.AwaitTaskContinuation.<ThrowAsyncIfNecessary>b__1(Object s)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Run Code Online (Sandbox Code Playgroud)

然后它崩溃了.

这是WintRT特有的问题吗?

有解决方法吗?

Joe*_*ite 2

根据该错误消息的 MSDN 文档,该错误的修复方法是“关闭某些应用程序”或“增加分页文件的大小”。

鉴于此,您可能需要首先查看任务管理器,看看您的应用程序是否使用了完全不合理的内存量(或者其他进程是否使用了完全不合理的内存量)。如果您的进程存在内存泄漏,则可能会导致此问题。