C Run-Time Error R6016
If you encounter this error message, the named program was shut down because it has an internal memory problem. There are many possible reasons for this error, but often it's caused by a defect in the program or by corruption of the Visual C++ libraries that it uses.
You can try these steps to fix this error:
This error occurs because the program did not receive enough memory from the operating system to complete a _beginthread or _beginthreadex call, or thread local storage has not been initialized by _beginthread or _beginthreadex.
When a new thread is started, the library must create an internal database for the thread. If the database cannot be expanded by using memory provided by the operating system, the thread does not begin and the calling process stops. This can happen when too many threads have been created by the process, or if thread local storage has been exhausted.
We recommend that an executable that calls the C run-time library (CRT) should use _beginthreadex for thread creation rather than the Windows API CreateThread. _beginthreadex initializes internal static storage used by many CRT functions in thread local storage. If you use CreateThread to create a thread, the CRT may terminate the process with R6016 when a call is made to a CRT function that requires initialized internal static storage.