Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a limit to the number of tasks?

I am running a winrt program with multiple tasks. In the middle of running, I get the following exception:

Not enough quota is available to process this command

The stack trace is

   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()

Then it crashes.

Is this a problem specific to WintRT?

Is there a workaround?

like image 654
user380719 Avatar asked Nov 04 '22 01:11

user380719


1 Answers

According to the MSDN documentation for that error message, the fix for that error is to either "close some applications" or "increase the size of your paging file".

Given that, you might want to start by looking in Task Manager and see if your application is using a totally unreasonable amount of memory (or if some other process is). If your process has a memory leak, it might lead to this problem.

like image 129
Joe White Avatar answered Nov 14 '22 23:11

Joe White